Skip to content

Export agent instance context JSON

GET
/api/v1/agent_instance/{agent_instance_id}/agent_context
curl --request GET \
--url 'https://app.prefactorai.com/api/v1/agent_instance/013xrzp12g3nqk8ns6jadrqmpgrjkeny/agent_context?include_risk_level=false' \
--header 'Authorization: Bearer <token>'
agent_instance_id
required
AgentInstance_Id

A valid agent instance ID

string
Example
013xrzp12g3nqk8ns6jadrqmpgrjkeny
idempotency_key
One of:

Optional idempotency key for ensuring request idempotency

string
include_risk_level

Score spans against the agent risk profile (default: false)

boolean

Success

Media typeapplication/json
object
agent_context
AgentInstance_AgentContext
object
body

Minimal JSON context with agent_instance, agent, and spans

object
key
additional properties
any
generated_at

When this context was generated

string format: date-time
span_count

Number of spans on the main agent instance

integer
status
string
Allowed values: success
Example
{
"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"
}