Delete an API token
DELETE
/api/v1/api_token/{api_token_id}
const url = 'https://app.prefactorai.com/api/v1/api_token/013xrzp12g3nqk8ns6jadrqmpgrjkeny';const options = { method: 'DELETE', 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 DELETE \ --url https://app.prefactorai.com/api/v1/api_token/013xrzp12g3nqk8ns6jadrqmpgrjkeny \ --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
required
ApiToken_Details
object
account_id
required
Account_Id
A valid account ID
string
agent_deployment_id
required
One of:
AgentDeployment_Id
A valid agent deployment ID
string
Null
Null
string
available_actions
required
ApiToken_AvailableActions
Available actions for this token based on its status
object
activate
required
Whether the token can be activated
boolean
delete
required
Whether the token can be deleted
boolean
revoke
required
Whether the token can be revoked
boolean
suspend
required
Whether the token can be suspended
boolean
created_by_admin_user_id
required
One of:
AdminUser_Id
A valid admin user ID
string
Null
Null
string
environment_id
required
One of:
Environment_Id
A valid environment ID
string
Null
Null
string
expires_at
required
When the token expires
string format: date-time
id
required
ApiToken_Id
A valid API token ID
string
inserted_at
required
When the token was created
string format: date-time
last_used_at
required
status
required
Current status of the token
string
token_scope
required
Scope of the token
string
type
required
Type of resource (always ‘api_token’)
string
updated_at
required
When the token was last updated
string format: date-time
status
required
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
Media typeapplication/json
One of:
object
code
required
string
message
required
string
status
required
string
object
code
required
string
errors
required
object
key
additional properties
object recursive
message
required
string
status
required
string
object
code
required
string
message
required
string
retry_after_ms
required
Milliseconds until the client may retry.
integer
status
required
string
Example
{ "code": "bad_request", "status": "error"}