Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
sessions
curl -X POST https://api.dari.dev/v1/agents/agt_123/sessions \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json"
{
  "id": "sess_123",
  "agent_id": "agt_123",
  "status": "idle",
  "version_id": "ver_9",
  "last_message_id": null,
  "last_message_status": null,
  "created_at": "2026-03-31T18:40:00Z"
}
Creates a durable session for an agent. The session uses the agent version that is active when the session is created.

Path Parameters

agent_id
string
required
Agent ID.

Headers

Authorization
string
required
Bearer token using your Dari API key.
Content-Type
string
If present, use application/json.

Response Fields

id
string
Session ID.
agent_id
string
Agent ID.
status
string
Session status: active, idle, completed, failed, or expired.
version_id
string
Agent version used by this session.
last_message_id
string
Most recent message ID, if any.
last_message_status
string
Most recent message status, if any.
created_at
string
ISO 8601 creation timestamp.
curl -X POST https://api.dari.dev/v1/agents/agt_123/sessions \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -H "Content-Type: application/json"
{
  "id": "sess_123",
  "agent_id": "agt_123",
  "status": "idle",
  "version_id": "ver_9",
  "last_message_id": null,
  "last_message_status": null,
  "created_at": "2026-03-31T18:40:00Z"
}