Agents

Chat with a Coherence agent

Send a message to a Coherence agent (Nash by default). The agent runs its multi-step tool loop inside the workspace (for example records, documents, research and outreach drafts) and returns its final natural-language response. Tools the agent invokes still flow through the workspace's approval system, so this cannot bypass approval gates. Requires the agents:write scope, and the key's user must hold the agents:run permission (403 otherwise).

Response modes. By default the endpoint returns a single JSON object once the run completes. To receive incremental progress, request a stream by sending Accept: text/event-stream (or adding ?stream=true); the response is then a Server-Sent Events stream. Named events: open ({ agentId }), token ({ text } — a chunk of the final answer; concatenate across events), tool_call ({ tool, label }), done (the same object as the synchronous JSON body), and error ({ message }). Lines beginning with : are keepalives. Raw model reasoning and raw tool output are never streamed. Disconnecting the client aborts the run.

post/agents/messages

Request

  • Base URL: https://api.getcoherence.io/v1
  • URL: https://api.getcoherence.io/v1/agents/messages
  • Auth: HTTP bearer

Query parameters

stream'true'

Set to true to receive a Server-Sent Events stream instead of a single JSON response (equivalent to sending Accept: text/event-stream).

Request body

messagestring required
agentIdstring uuid

Optional. Targets a specific agent (with its custom system prompt). Omit to use the default Nash agent.

Response

Agent response. application/json for the default synchronous mode; text/event-stream when a stream is requested via Accept: text/event-stream or ?stream=true.

responsestring

The agent's final natural-language reply

successboolean
durationMsinteger
toolCallsinteger
errorstring

Changes

No recorded changes to this operation across all 1 revision of this API.