---
title: "Get Queue Statistics"
method: GET
path: "/v1/environments/{environment_id}/work/stats?beta=true"
---

# Get Queue Statistics

`GET /v1/environments/{environment_id}/work/stats?beta=true`

Get statistics about the work queue for an environment.

## Path parameters

- `environment_id` string, required

## Headers

- `anthropic-beta` string — Optional header to specify the beta version(s) you want to use. To use multiple betas, use a comma separated list like `beta1,beta2` or specify the header multiple times for each beta.
- `anthropic-version` string — The version of the Claude API you want to use. Read more about versioning and our version history [here](https://docs.claude.com/en/api/versioning).
- `x-api-key` string, nullable
- `authorization` string, nullable

## Response `200`

Successful Response

- BetaSelfHostedWorkQueueStats — Statistics about the work queue for an environment. Uses Redis Stream consumer group metrics for O(1) queries.
  - `depth` integer, required — Number of work items waiting to be picked up (lag from consumer group)
  - `oldest_queued_at` string, nullable, required — RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty
  - `pending` integer, required — Number of work items being processed (polled but not acknowledged)
  - `type` 'work_queue_stats', required — The type of object
  - `workers_polling` integer, nullable, required — Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.

## Other responses

- `4XX` — Error response. See our [errors documentation](https://docs.claude.com/en/api/errors) for more details.

## Changes

- **2026-05-19** `40e330aba8bc` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/anthropics/apis/anthropic-api/changes/v1/environments/:environment_id/work/stats?beta=true/get.md)

---

[API](https://skmtc.dev/anthropics/apis/anthropic-api.md) · [All operations](https://skmtc.dev/anthropics/apis/anthropic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anthropics/apis/anthropic-api/revisions/478045ff0f4f?raw)
