---
title: "Get Work Item"
method: GET
path: "/v1/environments/{environment_id}/work/{work_id}?beta=true"
---

# Get Work Item

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

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Retrieve detailed information about a specific work item.

## Path parameters

- `environment_id` string, required
- `work_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://platform.claude.com/docs/en/api/versioning).
- `x-api-key` string, nullable

## Response `200`

Successful Response

- BetaSelfHostedWork — Work resource representing a unit of work in a self-hosted environment. Work items are queued when sessions are created or when long-dormant sessions receive new messages. The environment worker polls for work to execute in a self-hosted sandbox.
  - `acknowledged_at` string, nullable, required — RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox
  - `created_at` string, required — RFC 3339 timestamp when work was created
  - `data` BetaSessionWorkData, required — Work data for session work items. This resource type is used when work represents a session that needs to be executed in a self-hosted environment.
    - `id` string, required — Session identifier (e.g., 'session_...')
    - `type` 'session', required — Type of work data
  - `environment_id` string, required — Environment identifier this work belongs to (e.g., `env_...`)
  - `id` string, required — Work identifier (e.g., 'work_...')
  - `latest_heartbeat_at` string, nullable, required — RFC 3339 timestamp of the most recent heartbeat
  - `metadata` object, required — User-provided metadata key-value pairs associated with this work item
  - `secret` string, nullable, required — Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.
  - `started_at` string, nullable, required — RFC 3339 timestamp when work execution started
  - `state` 'queued' | 'starting' | 'active' | 'stopping' | 'stopped', required — Current state of the work item
  - `stop_requested_at` string, nullable, required — RFC 3339 timestamp when stop was requested
  - `stopped_at` string, nullable, required — RFC 3339 timestamp when work execution stopped
  - `type` 'work', required — The type of object (always 'work')

## Other responses

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

---

[API](https://skmtc.net/anthropics/apis/anthropic-api.md) · [All operations](https://skmtc.net/anthropics/apis/anthropic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anthropics/anthropic-api/revisions/93d8fd7d6493/schema)
