AmplifyGen3 / Client / revoke_api_key

revoke_api_key

AmplifyGen3.Client.revoke_api_key(**kwargs)

Revokes an API key for a branch. A revoked key has a status of INACTIVE and is rejected. You can’t reactivate a revoked key, and Amplify doesn’t create a replacement key. Revoking a key that is already revoked succeeds and leaves the key INACTIVE.

See also: AWS API Documentation

Request Syntax

response = client.revoke_api_key(
    BranchArn='string',
    ApiKeyId='string'
)
Parameters:
  • BranchArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the branch that the API key belongs to.

  • ApiKeyId (string) –

    [REQUIRED]

    The ID of the API key to revoke.

Return type:

dict

Returns:

Response Syntax

{
    'ApiKeyId': 'string',
    'Status': 'ACTIVE'|'INACTIVE'
}

Response Structure

  • (dict) –

    • ApiKeyId (string) –

      The ID of the API key that was revoked.

    • Status (string) –

      The status of the API key after the request. The status is always INACTIVE.

Exceptions

  • AmplifyGen3.Client.exceptions.ThrottlingException

  • AmplifyGen3.Client.exceptions.AccessDeniedException

  • AmplifyGen3.Client.exceptions.ResourceNotFoundException

  • AmplifyGen3.Client.exceptions.ValidationException

  • AmplifyGen3.Client.exceptions.InternalServerException