Skip to content

Suspend an API token

POST
/api/v1/api_token/{api_token_id}/suspend
curl --request POST \
--url https://app.prefactorai.com/api/v1/api_token/013xrzp12g3nqk8ns6jadrqmpgrjkeny/suspend \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data null
api_token_id
required
ApiToken_Id

A valid API token ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
One of:

Optional idempotency key for ensuring request idempotency

string

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
agent_id
One of:
Agent_Id

A valid agent ID

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
environment_id
One of:
Environment_Id

A valid environment ID

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
One of:

When the token was last used for authentication

string format: date-time
status

Current status of the token

string
Allowed values: active suspended revoked
token_scope

Scope of the token

string
Allowed values: account agent_deployment
type

Type of resource (always ‘api_token’)

string
Allowed values: api_token
updated_at

When the token was last updated

string format: date-time
status
string
Allowed values: success
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"
}

Error

Media typeapplication/json
One of:
object
code
string
Allowed values: bad_request bad_authtoken not_authenticated not_permitted not_implemented unknown not_found unexpected_ref_type unexpected invalid_action alert_unknown alert_already_cleared invalid_value required_value idempotency_key_already_used
message
string
status
string
Allowed values: error
Example
{
"code": "bad_request",
"status": "error"
}