Stop Work
api/beta/environments/work/stop
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/environments/work/stop Changed · +17 / -22 lines
# Stop Work ## Path parameters ## Headers ## Body parameters ## Returns ## Example ### Response (200) ## Stop Work ### Path Parameters ### Header Parameters ### Body Parameters ### Returns ### Example #### Response
---- -title: Stop Work -url: https://platform.claude.com/docs/en/api/beta/environments/work/stop ---- +# Stop Work -## Stop Work +**POST** `/v1/environments/{environment_id}/work/{work_id}/stop` -**post** `/v1/environments/{environment_id}/work/{work_id}/stop` - 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. Stop a work item, initiating graceful or forced shutdown. -### Path Parameters +## Path parameters - `environment_id: string` - `work_id: string` -### Header Parameters +## Headers - `"anthropic-beta": optional array of AnthropicBeta`
- `"mid-conversation-tool-changes-2026-07-01"` -### Body Parameters +## Body parameters - `force: optional boolean` If true, immediately stop work without graceful shutdown -### Returns + default: false -- `BetaSelfHostedWork object { id, acknowledged_at, created_at, 10 more }` +## Returns +- `BetaSelfHostedWork object` + 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
Type of work data - - `"session"` - - `environment_id: string` Environment identifier this work belongs to (e.g., `env_...`)
The type of object (always 'work') - - `"work"` + default: work -### Example +## Example -```http +```bash curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID/stop \ -H 'Content-Type: application/json' \ -H 'anthropic-version: 2023-06-01' \
-d '{}' ``` -#### Response +### Response (200) ```json {