Skip to main content
POST
/
sessions
/
{session_id}
/
end
End a session
curl --request POST \
  --url https://api.deck.co/v2/sessions/{session_id}/end \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "object": "<string>",
  "status": "<string>",
  "runtime_ms": 123,
  "task_runs": [
    {
      "id": "<string>",
      "task_id": "<string>",
      "agent_id": "<string>",
      "credential_id": "<string>"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Secret key (sk_live_...)

Path Parameters

session_id
string
required

Unique identifier for the session (prefixed with sess_).

Response

OK

A session object representing an isolated compute session for executing tasks.

id
string
required

Unique identifier for the session, prefixed with sess_.

object
string
required

Always session.

status
string
required

Session status: queued, running, idle, completed, or failed.

runtime_ms
required

Total session runtime in milliseconds.

task_runs
object[]
required

Task runs executed within this session.

created_at
string<date-time>
required

ISO 8601 timestamp of when the resource was created.

updated_at
string<date-time>
required

ISO 8601 timestamp of when the resource was last updated.

request_id
string
required

Unique identifier for the API request. Include this when contacting support.