Revoke an API key
DELETE
/v1/keys/{key_id}
const url = 'https://api.pensievelabs.co/v1/keys/key_8c1f20';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.pensievelabs.co/v1/keys/key_8c1f20 \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”key_id
required
string
Example
key_8c1f20Responses
Section titled “Responses”The revoked key.
Media typeapplication/json
object
id
required
string
object
required
name
required
string
prefix
required
string
secret
The whole key, in the response that creates it only.
string
created_at
required
string format: date-time
last_used_at
required
string | null format: date-time
revoked_at
required
string | null format: date-time
Example
{ "id": "key_8c1f20", "object": "api_key", "prefix": "pk_live_7f3a"}default
Section titled “default”Something went wrong; error.type says what.
Media typeapplication/json
object
error
required
object
type
required
string
message
required
string
param
The request field the error is about.
string | null
request_id
required
string
Example
{ "error": { "type": "invalid_request" }}