Fetch agent by lookup
const url = 'https://app.prefactorai.com/api/v1/agent/show?agent_id=013xrzp12g3nqk8ns6jadrqmpgrjkeny&include_counts=false&include_risk_rollup=false';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/show?agent_id=013xrzp12g3nqk8ns6jadrqmpgrjkeny&include_counts=false&include_risk_rollup=false' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”A valid agent ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyAgent id. Provide exactly one of agent_id or external_identifier.
External identifier for this agent (exact match). Provide exactly one of agent_id or external_identifier.
A valid environment ID
Example
013xrzp12g3nqk8ns6jadrqmpgrjkenyNull
Include instance counts in the response
Include risk rollup (theoretical and observed risk) in the response
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
object
object
List of all data categories included across span types
Number of span types with risk data
Count of span types at each classification level
object
Number of span types with external communication allowed
Highest classification level across all span types
Total number of span types
Number of span types without risk data
Null
object
List of all data categories included across span types
Number of span types with risk data
Count of span types at each classification level
object
Number of span types with external communication allowed
Highest classification level across all span types
Total number of span types
Number of span types without risk data
Null
Null
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" }, "risk_rollup": null, "status": "success"}default
Section titled “default”Error