Skip to main content
POST
/
v1
/
sessions
/
{session_id}
/
messages
curl -X POST https://api.dari.dev/v1/sessions/sess_123/messages \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      { "type": "text", "text": "Summarize this ticket and draft a reply." },
      { "type": "file", "file_id": "file_456" },
      { "type": "image", "file_id": "file_789" }
    ],
    "metadata": {
      "ticket_id": "T-1042"
    }
  }'
{
  "id": "msg_123",
  "session_id": "sess_123",
  "status": "queued",
  "attempt": 1,
  "created_at": "2026-03-31T18:40:00Z",
  "completed_at": null
}
Sends a message to a session and returns immediately after the message is queued. Use this endpoint when you want to poll for completion later with the session and message APIs.

Path Parameters

session_id
string
required
Session ID.

Headers

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

Request Body

parts
object[]
required
Ordered list of message parts.
metadata
object
Optional metadata attached to the message.

Response Fields

id
string
Message ID.
session_id
string
Session ID.
status
string
Initial message status, typically queued.
attempt
integer
Current attempt count.
created_at
string
ISO 8601 creation timestamp.
completed_at
string
Null until the message completes.
curl -X POST https://api.dari.dev/v1/sessions/sess_123/messages \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parts": [
      { "type": "text", "text": "Summarize this ticket and draft a reply." },
      { "type": "file", "file_id": "file_456" },
      { "type": "image", "file_id": "file_789" }
    ],
    "metadata": {
      "ticket_id": "T-1042"
    }
  }'
{
  "id": "msg_123",
  "session_id": "sess_123",
  "status": "queued",
  "attempt": 1,
  "created_at": "2026-03-31T18:40:00Z",
  "completed_at": null
}