Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
messages
curl -X POST https://api.dari.dev/v1/agents/agt_123/messages \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "user.message",
    "content": [
      { "type": "text", "text": "Summarize this ticket and draft a reply." }
    ],
    "metadata": {
      "ticket_id": "T-1042"
    },
    "session": {
      "name": "Ticket T-1042"
    }
  }'
{
  "event": {
    "id": "sess_123:evt_1",
    "session_id": "sess_123",
    "sequence_number": 1,
    "message_id": "msg_123",
    "type": "user.message",
    "source": "user",
    "actor": { "type": "user", "id": "org_123" },
    "data": {
      "content": [
        { "type": "text", "text": "Summarize this ticket and draft a reply." }
      ],
      "metadata": { "ticket_id": "T-1042" },
      "message_id": "msg_123"
    },
    "created_at": "2026-03-31T18:40:00Z"
  },
  "message": {
    "id": "msg_123",
    "status": "queued"
  },
  "session": {
    "id": "sess_123",
    "name": "Ticket T-1042",
    "agent_id": "agt_123",
    "version_id": "ver_123",
    "storage_binding_id": null,
    "internet_access": false,
    "status": "running",
    "last_message_id": "msg_123",
    "last_message_status": "queued",
    "created_at": "2026-03-31T18:40:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.dari.dev/llms.txt

Use this file to discover all available pages before exploring further.

Create a new session for an agent and send the first user.message in one request. Use this when you want to start work immediately and do not already have a session_id. The response includes the new session, the recorded event, and the queued message summary. Save session.id from the response if you want to continue the same conversation with Send Session Events.

Path Parameters

agent_id
string
required
Agent ID.

Headers

Authorization
string
required
Bearer token using your Dari API key.
Content-Type
string
required
Must be application/json.

Request Body

type
string
required
Must be user.message.
content
object[]
required
Ordered list of content blocks. Blocks support text, file, and image.
metadata
object
Optional metadata attached to the derived message.
session
object
Optional session creation options. Supports the same fields as Create Session, including name, storage_binding_id, secrets, llm_api_key, and internet_access.

Response Fields

event
object
The canonical ledger event that was recorded for the first user message.
message
object
The derived message summary.
session
object
The newly created session after the message was queued.
curl -X POST https://api.dari.dev/v1/agents/agt_123/messages \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "user.message",
    "content": [
      { "type": "text", "text": "Summarize this ticket and draft a reply." }
    ],
    "metadata": {
      "ticket_id": "T-1042"
    },
    "session": {
      "name": "Ticket T-1042"
    }
  }'
{
  "event": {
    "id": "sess_123:evt_1",
    "session_id": "sess_123",
    "sequence_number": 1,
    "message_id": "msg_123",
    "type": "user.message",
    "source": "user",
    "actor": { "type": "user", "id": "org_123" },
    "data": {
      "content": [
        { "type": "text", "text": "Summarize this ticket and draft a reply." }
      ],
      "metadata": { "ticket_id": "T-1042" },
      "message_id": "msg_123"
    },
    "created_at": "2026-03-31T18:40:00Z"
  },
  "message": {
    "id": "msg_123",
    "status": "queued"
  },
  "session": {
    "id": "sess_123",
    "name": "Ticket T-1042",
    "agent_id": "agt_123",
    "version_id": "ver_123",
    "storage_binding_id": null,
    "internet_access": false,
    "status": "running",
    "last_message_id": "msg_123",
    "last_message_status": "queued",
    "created_at": "2026-03-31T18:40:00Z"
  }
}