Sample - Stripe API
DELETE/v1/ephemeral_keys/{key}

Invalidate an ephemeral key

Deletes an ephemeral key immediately. Use key to identify the short-lived credential that should no longer grant access to its scoped resource.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
keystringrequired
The ephemeral key identifier, limited to 5000 characters.

Optional form-encoded request body containing no defined fields.

expandarray<string>optional
Specifies which fields in the response should be expanded.

2 status codes
200Returns the invalidated ephemeral key object with its identifier, creation time, expiration time, live-mode state, and object type.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
expiresintegerrequired
Time at which the key will expire. Measured in seconds since the Unix epoch.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:ephemeral_key
secretstringoptional
The key's secret. You can use this value to make authorized requests to the Stripe API.
defaultReturned when the API cannot process the invalidation; the response contains an error object.
errorobjectrequired

Error handling

key must be a string of no more than 5000 characters. The request body has no defined fields, so provide the key path value to identify the credential to invalidate.