POST
Create a session

Authorizations

Authorization
string
header
required

A server API key, ask_.... Carries a role.

Headers

Idempotency-Key
string

Up to 255 characters. The key is scoped to the calling principal, the HTTP method, the path and the key. Only 2xx responses are stored, for 24 hours. The same key with the same body replays the stored response, with the response header Idempotency-Replayed: true. The same key with a different body is 422 idempotency_key_reuse. If the first request is still running, the answer is 409 idempotency_in_progress; a record in progress for more than 60 seconds is taken over by the new request. A key that is longer than 255 characters or not printable ASCII is 400 invalid_idempotency_key.

Maximum string length: 255

Body

application/json
agent_id
string
required
environment_id
string
required
title
string
Maximum string length: 200
metadata
object

Response

The new session.

id
string
required
object
string
required
Allowed value: "session"
agent_id
string
required
environment_id
string
required
status
enum<string>
required
Available options:
idle,
running,
waiting_for_worker,
interrupted,
error,
archived
metadata
object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
title
string | null
status_reason
string | null

A code that says why, for example no_worker while status is waiting_for_worker.

last_seq
integer

The seq of the newest event.

archived_at
string<date-time> | null