Revoke Key
POST
/v1/keys/{key_id}/revoke
const url = 'https://example.com/v1/keys/example/revoke';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"by":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/keys/example/revoke \ --header 'Content-Type: application/json' \ --data '{ "by": "example" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key_id
required
Key Id
string
Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Media type application/json
ApiKeyRecord
The browser-/SDK-safe view of a key. The plaintext and its hash are NEVER in here — only a masked display string + the last four chars.
object
id
required
Id
string
name
required
Name
string
env
required
Env
string
prefix
required
Prefix
string
masked
required
Masked
string
last4
required
Last4
string
scopes
Scopes
Array<string>
status
required
Status
string
createdAt
required
Createdat
string
Example generated
{ "id": "example", "name": "example", "env": "example", "prefix": "example", "masked": "example", "last4": "example", "scopes": [ "example" ], "status": "example", "tenantId": "example", "createdBy": "example", "createdAt": "example", "lastUsedAt": "example", "revokedAt": "example", "revokedBy": "example", "rotatedAt": "example", "rotatedFrom": "example"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}