List agents
const url = 'https://app.prefactorai.com/api/v1/agent';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.prefactorai.com/api/v1/agent \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”A valid risk profile ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Sort order; a field name, optionally prefixed with - for descending (e.g. -id). Supported fields: id, name, status, last_activity_span_at.
Sort order; a field name, optionally prefixed with - for descending (e.g. -id). Supported fields: id, name, status, last_activity_span_at.
Zero-based offset of the first item to return.
Number of items to return per page (1-100).
Responses
Section titled “Responses”Success
object
Pagination information
object
The total number of items
The index of the last item in the page (one-based)
The index of the first item in the page (one-based)
The total number of pages
The index of the current page (one-based)
The offset of the first item in the page (zero-based)
The number of items per page
Null
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
Agent status
Type of resource (always ‘agent’)
When the agent was last updated
Example
{ "pagination": { "item_count": 200, "item_end": 100, "item_start": 91, "next_page_offset": 110, "page_count": 20, "page_index": 10, "page_offset": 90, "page_size": 10, "previous_page_offset": 80 }, "sorting": null, "status": "success", "summaries": [ { "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", "status": "pending", "team_id": "013xrzp12g3nqk8ns6jadrqmpgrjkeny", "type": "agent", "updated_at": "2024-01-01T00:00:00Z" } ]}default
Section titled “default”Error