sessions

List sessions in the current environment, newest first. Filter by type, tags, task identifier, external id, status, and creation window. Use cursor-based pagination with page[after] and page[before] to navigate pages.

List rows omit triggerConfig; retrieve a single session to read it.

get/api/v1/sessions

Request

Query parameters

sizeinteger

Number of sessions per page. Maximum is 100.

afterstring

The ID of the session to start the page after. Sets the pagination direction to forward.

beforestring

The ID of the session to start the page before. Sets the pagination direction to backward.

Paginate the results. Specify the number of sessions per page, and the ID of the session to start the page after or before.

For object fields like page, use the "form" encoding style. For example, to get the next page, use page[after]=session_1234.

typestring[]

The session type(s) to filter by.

tagsstring[]

The tags to filter by.

taskIdentifierstring[]

The task identifier(s) to filter by.

externalIdstring

Exact match on your externalId.

statusstring[]

The lifecycle status(es) to filter by.

Use this parameter to filter the sessions. You can filter by type, tags, task identifier, external id, status, and created at.

For array fields, you can provide multiple values to filter by using a comma-separated list. For example, to get ACTIVE and CLOSED sessions, you can use filter[status]=ACTIVE,CLOSED.

For object fields, you should use the "form" encoding style. For example, to filter by the period, you can use filter[createdAt][period]=1d.

{
  "type": [
    "chat.agent"
  ],
  "createdAt": {
    "period": "1d"
  }
}

Response

Successful request

Example response

{
  "data": [
    {
      "id": "session_abc123",
      "externalId": "chat_1234",
      "type": "chat.agent",
      "taskIdentifier": "my-chat",
      "triggerConfig": {
        "machine": "small-1x",
        "lockToVersion": "20240523.1"
      },
      "currentRunId": "run_def456",
      "tags": [
        "chat:1234"
      ]
    }
  ],
  "pagination": {
    "next": "session_abc123",
    "previous": "session_xyz789"
  }
}

Changes