Pular para o conteúdo principal
POST
Run agent (single-shot)

Autorizações

X-API-Key
string
header
obrigatório

Parâmetros de caminho

agent_id
string
obrigatório

Corpo

application/json
messages
MessageCreateRequest · object[]
obrigatório

Messages to seed the run with. Only role: 'user' messages drive the agent; non-user roles in this list are silently ignored (not persisted, not dispatched). If a user message hits a HITL pause (pending_approval), any remaining messages in the list are not dispatched and must be re-sent after the pause is resolved.

Required array length: 1 - 10 elements
user
SessionUser · object | null

End-user of a session, addressed by id or by reference.

id is lookup-only: it never writes, so name/email/phone sent with it are ignored. reference is an upsert key: unknown references are created, known ones are merged with the display fields provided here — fields left out keep their stored value.

Defined here (rather than in a surface's schemas.py) because both the agent and the public/widget surfaces expose the very same field and must validate it identically. Re-exported by api/v1/external/agent/schemas.py for backwards compatibility.

context
Context · object | null

Free-form key/value pairs injected into the agent's system context for this run.

metadata
Metadata · object | null

Integrator-defined storage. Not seen by the agent.

persist
boolean
padrão:true

If true, a session is created and persisted. If false, the run is intended to be ephemeral (current implementation still persists; this will change in a future release).

Resposta

Successful Response

agent_message
Message · object
obrigatório
session_id
string | null
status
enum<string>
padrão:completed
Opções disponíveis:
completed,
pending_approval