Built-in agent
Agent sessions, their events, messages, budget and tool approvals.
On this page
Concepts: Built-in agent
Endpoint summaries come from the OpenAPI document.
GET/v1/agent/sessions
Built-in agent sessions of the team (full sign-in only)
- Operation (MCP tool)
listAgentSessions- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
POST/v1/agent/sessions
Start the built-in agent: it builds and publishes a preview version. Spends agent credits up to the budget
- Operation (MCP tool)
startAgentSession- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Request body
application/jsonobjectRequired
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
- agent_budget_invalid
- agent_consent_required
- agent_credits_exhausted
- agent_not_configured
- agent_provider_error
- agent_session_ended
- agent_session_paused
- agent_session_waiting
- docs_unavailable
- forbidden
- idempotency_key_in_progress
- included_usage_exhausted
- not_found
- spend_limit_reached
- team_suspended
- unauthorized
- validation_error
GET/v1/agent/sessions/{session}
One agent session
- Operation (MCP tool)
getAgentSession- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
GET/v1/agent/sessions/{session}/events
Conversation and progress of an agent session, oldest first; pass after=<seq> for new events
- Operation (MCP tool)
listAgentEvents- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
POST/v1/agent/sessions/{session}/messages
Send a message to the agent
- Operation (MCP tool)
sendAgentMessage- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Request body
application/jsonobjectRequired
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
POST/v1/agent/sessions/{session}/interrupt
Stop what the agent is doing
- Operation (MCP tool)
interruptAgentSession- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
POST/v1/agent/sessions/{session}/budget
Change the session budget; a paused session continues
- Operation (MCP tool)
setAgentBudget- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Request body
application/jsonobjectRequired
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.
POST/v1/agent/sessions/{session}/confirmations/{event}
Allow or deny a command the agent is waiting on
- Operation (MCP tool)
confirmAgentTool- Authentication
- API key (pfa_…)OAuth token (pfo_…)
Parameters
Request body
application/jsonobjectRequired
Responses
Related error codes
Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.