Skip to main content
POST
/
v1
/
sessions
/
{session_id}
/
events
curl -X POST https://api.dari.dev/v1/sessions/sess_123/events \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "type": "user.message",
        "content": [
          { "type": "text", "text": "Summarize this ticket and draft a reply." },
          { "type": "file", "file_id": "file_456" }
        ],
        "metadata": {
          "ticket_id": "T-1042"
        }
      }
    ]
  }'
{
  "events": [
    {
      "id": "evt_1",
      "session_id": "sess_123",
      "message_id": "msg_123",
      "type": "user.message",
      "data": {
        "content": [
          {
            "type": "text",
            "text": "Summarize this ticket and draft a reply."
          },
          {
            "type": "file",
            "file_id": "file_456"
          }
        ],
        "metadata": {
          "ticket_id": "T-1042"
        },
        "message_id": "msg_123"
      },
      "created_at": "2026-03-31T18:40:00Z"
    }
  ]
}
Accepts one or more session events and returns after they are durably recorded. The current public write surface supports user.message only.

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

events
object[]
required
Ordered list of events to append.

Response Fields

events[].id
string
Persisted event ID.
events[].message_id
string
Derived durable message ID for user.message.
events[].type
string
Persisted event type.
events[].data
object
Event payload, including the derived message_id.
curl -X POST https://api.dari.dev/v1/sessions/sess_123/events \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "type": "user.message",
        "content": [
          { "type": "text", "text": "Summarize this ticket and draft a reply." },
          { "type": "file", "file_id": "file_456" }
        ],
        "metadata": {
          "ticket_id": "T-1042"
        }
      }
    ]
  }'
{
  "events": [
    {
      "id": "evt_1",
      "session_id": "sess_123",
      "message_id": "msg_123",
      "type": "user.message",
      "data": {
        "content": [
          {
            "type": "text",
            "text": "Summarize this ticket and draft a reply."
          },
          {
            "type": "file",
            "file_id": "file_456"
          }
        ],
        "metadata": {
          "ticket_id": "T-1042"
        },
        "message_id": "msg_123"
      },
      "created_at": "2026-03-31T18:40:00Z"
    }
  ]
}
Use List Session Events or Stream Session Events for the session-wide execution log, and Get Message for the per-turn read model.