Skip to navigation

Revoke a customer API key

Revokes one of this customer’s keys, which then stops authenticating. Keys are never deleted: a revoked key stays listed with revokedAt set, and deleting the customer revokes its keys too. Revoking an already revoked key returns it unchanged. 404 when the key does not belong to this customer. Use the value returned as customer.id, for example cus_abc123; if you have your own customer ID, use the /api/v2/customers/external/{externalId}/… twin.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Path parameters

idstringRequiredformat: "^cus_.+"
Paid customer display id
apiKeyIdstringRequiredformat: "uuid"
The key's id, as returned by create or list.

Response

200
idstringformat: "uuid"
The key's id.
namestring
descriptionstring or null
customerIdstring or null

Display id (cus_…) of the customer the key acts for.

customerExternalIdstring or null
That customer's id in your system, if it has one.
scopeslist of strings
What the key may do.
keyPrefixstring
The key's first characters, to recognise it in a list.
last4string
The key's last four characters.
statusenum

ACTIVE until the key is revoked (REVOKED) or its expiry passes (EXPIRED).

Allowed values:
createdAtdatetime
lastUsedAtdatetime or null
expiresAtdatetime or null
revokedAtdatetime or null

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error