Revoke an API key
POST
/v1/api-keys/{id}/revoke
const url = 'https://api.staging.heliumid.io/v1/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/revoke';const options = {method: 'POST', headers: {cookie: 'hl.session_token=<hl.session_token>'}};
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://api.staging.heliumid.io/v1/api-keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/revoke \ --cookie hl.session_token=<hl.session_token>The key stops working on its next request.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Responses
Section titled “Responses”Revoked: the key stops working on its next request. Revoking again changes nothing.
Media typeapplication/json
object
id
required
string
name
required
string
prefix
required
string
role
required
string
environment
required
string
status
required
string
createdAt
required
string
lastUsedAt
required
string | null
expiresAt
required
string | null
revokedAt
required
string | null
Example
{ "role": "operator", "environment": "test", "status": "active"}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
correlationId
required
string
Example generated
{ "error": { "code": "example", "message": "example", "correlationId": "example" }}Not authenticated
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
correlationId
required
string
Example generated
{ "error": { "code": "example", "message": "example", "correlationId": "example" }}Not allowed (needs a signed-in person with api_key.manage)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
correlationId
required
string
Example generated
{ "error": { "code": "example", "message": "example", "correlationId": "example" }}Not found
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
correlationId
required
string
Example generated
{ "error": { "code": "example", "message": "example", "correlationId": "example" }}