Revoke an API token
POST
/api/v1/api_token/{api_token_id}/revoke
const url = 'https://app.prefactorai.com/api/v1/api_token/013xrzp12g3nqk8ns6jadrqmpgrjkeny/revoke';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: 'null'};
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://app.prefactorai.com/api/v1/api_token/013xrzp12g3nqk8ns6jadrqmpgrjkeny/revoke \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data nullAuthorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”api_token_id
required
ApiToken_Id
A valid API token ID
string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyRequest Body
Section titled “Request Body”Responses
Section titled “Responses”Success
Media typeapplication/json
object
details
ApiToken_Details
object
account_id
Account_Id
A valid account ID
string
agent_deployment_id
One of:
AgentDeployment_Id
A valid agent deployment ID
string
Null
Null
string
available_actions
ApiToken_AvailableActions
Available actions for this token based on its status
object
activate
Whether the token can be activated
boolean
delete
Whether the token can be deleted
boolean
revoke
Whether the token can be revoked
boolean
suspend
Whether the token can be suspended
boolean
created_by_admin_user_id
One of:
AdminUser_Id
A valid admin user ID
string
Null
Null
string
environment_id
One of:
Environment_Id
A valid environment ID
string
Null
Null
string
expires_at
When the token expires
string format: date-time
id
ApiToken_Id
A valid API token ID
string
inserted_at
When the token was created
string format: date-time
last_used_at
status
Current status of the token
string
token_scope
Scope of the token
string
type
Type of resource (always ‘api_token’)
string
updated_at
When the token was last updated
string format: date-time
status
string
Example
{ "details": { "account_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_deployment_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "agent_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "created_by_admin_user_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "environment_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "expires_at": "2024-01-01T00:00:00Z", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "last_used_at": "2024-01-01T00:00:00Z", "status": "active", "token_scope": "account", "type": "api_token", "updated_at": "2024-01-01T00:00:00Z" }, "status": "success"}default
Section titled “default”Error