:doc:`IoT <../../iot>` / Client / delete_certificate

******************
delete_certificate
******************



.. py:method:: IoT.Client.delete_certificate(**kwargs)

  

  Deletes the specified certificate.

   

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

   

  Requires permission to access the `DeleteCertificate <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCertificate>`_  


  **Request Syntax**
  ::

    response = client.delete_certificate(
        certificateId='string',
        forceDelete=True|False
    )
    
  :type certificateId: string
  :param certificateId: **[REQUIRED]** 

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

    

  
  :type forceDelete: boolean
  :param forceDelete: 

    Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.CertificateStateException`

  
  *   :py:class:`IoT.Client.exceptions.DeleteConflictException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  