Menu
AWS IoT
Developer Guide

DeleteCertificate

Deletes the specified certificate.

A certificate cannot be deleted if it has a policy attached to it or if its status is set to ACTIVE. To delete a certificate, first use the DetachPrincipalPolicy API to detach all policies. Next, use the UpdateCertificate API to set the certificate to the INACTIVE status.

Request syntax:

DELETE /certificates/certificateId?forceDelete=forceDelete

URI Request Parameters:

Name

Type

Req?

Description

certificateId

CertificateId

yes

The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

forceDelete

ForceDelete

no

Forces a certificate request to be deleted.

Errors:

CertificateStateException

The certificate operation is not allowed.

HTTP response code: 406

DeleteConflictException

You can't delete the resource because it is attached to one or more resources.

HTTP response code: 409

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

CLI

Synopsis:

aws iot delete-certificate \ --certificate-id <value> \ [--force-delete | --no-force-delete] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "certificateId": "string", "forceDelete": "boolean" }

cli-input-json fields:

Name

Type

Description

certificateId

string

length max:64 min:64

pattern: (0x)?[a-fA-F0-9]+

The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

forceDelete

boolean

Forces a certificate request to be deleted.

Output:

None

On this page: