Delete an agent
const url = 'https://app.prefactorai.com/api/v1/agent/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/agent/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”A valid agent ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyRequest Body
Section titled “Request Body”Responses
Section titled “Responses”Success
object
object
Available actions for this agent based on its status and instance counts
object
Whether the agent can be deleted
Whether the agent can be reinstated from retired
Whether the agent can be retired
Whether the agent can be updated
A valid agent ID
When the agent was created
object
Number of instances with status active (running)
Number of instances with status cancelled
Number of instances with status complete
Number of instances with status failed
Number of instances in a finished state (complete + failed + cancelled + terminated)
Number of instances with status pending
Number of instances with status terminated
Total number of agent instances
Agent name
A valid risk profile ID
Null
Agent status
Type of resource (always ‘agent’)
When the agent was last updated
Example
{ "details": { "description": "Agent description", "external_identifier": "workflow-abc123", "id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "inserted_at": "2024-01-01T00:00:00Z", "instance_counts": { "active": 2, "cancelled": 0, "complete": 5, "failed": 0, "finished": 5, "pending": 0, "terminated": 0, "total": 10 }, "last_activity_span_at": "2024-01-01T00:00:00Z", "name": "My Agent", "owner_person_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "risk_profile_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "status": "pending", "team_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "type": "agent", "updated_at": "2024-01-01T00:00:00Z" }, "status": "success"}default
Section titled “default”Error