Skip to main content
Sessions

List sessions

List Forward sessions with filters and cursor pagination.

GET /api/v1/forward/sessions Lists sessions under the authenticated account in descending creation-time order by default. Archived sessions are excluded by default.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Query parameters

ParameterTypeRequiredDefaultDescription
identity_idsstring or arrayNo-Filter by one or more Identity IDs. Comma-separated strings are supported.
template_idstringNo-Filter by Forward Template ID.
source_typestringNo-Filter by api, im, schedule, or batch.
created_at[gt]stringNo-Created strictly after this RFC 3339 timestamp.
created_at[gte]stringNo-Created at or after this RFC 3339 timestamp.
created_at[lt]stringNo-Created strictly before this RFC 3339 timestamp.
created_at[lte]stringNo-Created at or before this RFC 3339 timestamp.
updated_at[gt]stringNo-Updated strictly after this RFC 3339 timestamp.
updated_at[gte]stringNo-Updated at or after this RFC 3339 timestamp.
updated_at[lt]stringNo-Updated strictly before this RFC 3339 timestamp.
updated_at[lte]stringNo-Updated at or before this RFC 3339 timestamp.
limitintegerNo20Items per page. Maximum 100.
after_idstringNo-Cursor for the next page. Pass the last_id from the previous response.
before_idstringNo-Cursor for the previous page. Pass the first_id from the current response.
orderstringNodescCreation-time sort order: desc or asc.
include_archivedbooleanNofalseInclude archived sessions.

Example request

curl -s -X GET 'https://api.qoder.com/api/v1/forward/sessions' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"
Get the next page:
curl -s -X GET 'https://api.qoder.com/api/v1/forward/sessions?limit=20&order=desc&after_id=sess_xxx' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "data": [
    {
      "id": "sess_xxx",
      "type": "session",
      "identity_id": "idn_xxx",
      "template": {
        "id": "tmpl_support",
        "type": "template",
        "name": "Support assistant",
        "model": "ultimate",
        "version": 3
      },
      "source_type": "im",
      "status": "idle",
      "title": "Customer support session",
      "metadata": {
        "source": "dingtalk"
      },
      "config": {
        "environment_variables": {
          "API_KEY": "sk-xxx"
        }
      },
      "stats": {
        "active_seconds": 30,
        "duration_seconds": 3600
      },
      "usage": {
        "total_credits": 12.5
      },
      "archived_at": null,
      "created_at": "2026-06-22T10:00:00Z",
      "updated_at": "2026-06-22T11:00:00Z"
    }
  ],
  "first_id": "sess_xxx",
  "last_id": "sess_xxx",
  "has_more": false
}

Response fields

FieldTypeDescription
dataarraySession objects on the current page.
first_idstring|nullID of the first record on this page.
last_idstring|nullID of the last record on this page.
has_morebooleanWhether more records remain.

Errors

HTTPTypeCodeTrigger
400invalid_request_errorinvalid_time_rangeTime filters are invalid.
400invalid_request_errorinvalid_time_filterThe time-filter format is invalid.
400invalid_request_errorinvalid_paginationPagination parameters are invalid.
400invalid_request_errorinvalid_limitlimit is invalid or exceeds the maximum.
400invalid_request_errorinvalid_orderorder is not asc or desc.
401authentication_errorauthentication_requiredPAT or SAT invalid or expired.

Notes

  • after_id and before_id cannot be used together.
  • The list is sorted by created_at. Sessions with the same creation time are sorted by Session ID in the same direction to keep pagination stable.
  • Keep the same filters and order value when paging through results.
  • Current design does not support filtering by status.
  • usage.total_credits is returned only for newly created Sessions. Historical Sessions may omit it.