Skip to main content
GET /api/v1/cloud/environments/{environment_id}/work Lists work items for a self_hosted Environment. Results use cursor pagination and are returned in ascending ID order, which matches queue creation order.

Path parameters

ParameterTypeDescription
environment_idstringEnvironment ID with the env_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT

Query parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo20Items per page. Must be positive; values above 100 are capped at 100
pagestringNo-Cursor returned by the previous response’s next_page
before_idstringNo-Return records before this work item ID
after_idstringNo-Return records after this work item ID
page, before_id, and after_id are mutually exclusive. See Pagination for cursor semantics.

Example request

curl -X GET "https://api.qoder.com/api/v1/cloud/environments/env_019e64e01a137caf953ac2ac7b42ec5c/work?limit=2" \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "data": [
    {
      "id": "work_019f3be4fd2475d9a784bf2c739e1194",
      "type": "work",
      "environment_id": "env_019e64e01a137caf953ac2ac7b42ec5c",
      "data": {
        "type": "session",
        "id": "sess_019f3be3fa66750bb9a1fbcde85b5fe1"
      },
      "state": "queued",
      "created_at": "2026-07-01T08:15:01Z",
      "acknowledged_at": null,
      "started_at": null,
      "latest_heartbeat_at": null,
      "stop_requested_at": null,
      "stopped_at": null,
      "metadata": {
        "job": "daily-report"
      }
    }
  ],
  "first_id": "work_019f3be4fd2475d9a784bf2c739e1194",
  "last_id": "work_019f3be4fd2475d9a784bf2c739e1194",
  "has_more": false,
  "next_page": null
}

Response fields

FieldTypeDescription
dataarray of Work item objectsWork items 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
next_pagestring|nullCursor for the next page. Equals last_id when has_more is true, otherwise null

Errors

HTTPTypeTrigger
400invalid_request_errorlimit is not a positive integer
400invalid_request_errorMore than one of page, before_id, and after_id was provided
400invalid_request_errorThe Environment is not self_hosted
401authentication_errorPAT invalid or expired
403permission_errorNot authorized for this operation
404not_found_errorEnvironment not found
See Errors for the full error envelope.

Cloud environment setup

Choose the container, network, and dependencies your agent runs in.