SPB Git

Repository Public

work.md 43.8 KB 2,095 lines markdown

1---2title: Work3url: https://platform.claude.com/docs/en/api/beta/environments/work4---56# Work78## Get Work Item910**GET** `/v1/environments/{environment_id}/work/{work_id}`1112Note: 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.1314Retrieve detailed information about a specific work item.1516### Path parameters1718- `environment_id: string`1920- `work_id: string`2122### Headers2324- `"anthropic-beta": optional array of AnthropicBeta`2526  Optional header to specify the beta version(s) you want to use.2728  - `string`2930  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`3132    - `"message-batches-2024-09-24"`3334    - `"prompt-caching-2024-07-31"`3536    - `"computer-use-2024-10-22"`3738    - `"computer-use-2025-01-24"`3940    - `"pdfs-2024-09-25"`4142    - `"token-counting-2024-11-01"`4344    - `"token-efficient-tools-2025-02-19"`4546    - `"output-128k-2025-02-19"`4748    - `"files-api-2025-04-14"`4950    - `"mcp-client-2025-04-04"`5152    - `"mcp-client-2025-11-20"`5354    - `"dev-full-thinking-2025-05-14"`5556    - `"interleaved-thinking-2025-05-14"`5758    - `"code-execution-2025-05-22"`5960    - `"extended-cache-ttl-2025-04-11"`6162    - `"context-1m-2025-08-07"`6364    - `"context-management-2025-06-27"`6566    - `"model-context-window-exceeded-2025-08-26"`6768    - `"skills-2025-10-02"`6970    - `"fast-mode-2026-02-01"`7172    - `"output-300k-2026-03-24"`7374    - `"user-profiles-2026-03-24"`7576    - `"user-profiles-2026-08-18"`7778    - `"user-profiles-2026-09-04"`7980    - `"advisor-tool-2026-03-01"`8182    - `"managed-agents-2026-04-01"`8384    - `"cache-diagnosis-2026-04-07"`8586    - `"dreaming-2026-04-21"`8788    - `"thinking-token-count-2026-05-13"`8990    - `"server-side-fallback-2026-06-01"`9192    - `"server-side-fallback-2026-07-01"`9394    - `"fallback-credit-2026-06-01"`9596    - `"fallback-credit-2026-07-01"`9798    - `"agent-memory-2026-07-22"`99100    - `"mid-conversation-tool-changes-2026-07-01"`101102    - `"compact-2026-01-12"`103104    - `"computer-use-2025-11-24"`105106    - `"mcp-tunnels-2026-06-22"`107108    - `"structured-outputs-2025-11-13"`109110    - `"task-budgets-2026-03-13"`111112    - `"thinking-display-updates-2026-08-18"`113114    - `"ce-user-management-2026-07-13"`115116    - `"mid-conversation-output-config-2026-07-01"`117118    - `"thinking-binding-controls-2026-08-01"`119120    - `"mid-conversation-system-clear-at-2026-08-21"`121122    - `"compact-2026-09-04"`123124- `"anthropic-workspace-id": optional string`125126### Returns127128- `BetaSelfHostedWork object`129130  Work resource representing a unit of work in a self-hosted environment.131132  Work items are queued when sessions are created or when long-dormant sessions133  receive new messages. The environment worker polls for work to execute in a134  self-hosted sandbox.135136  - `type: "work"`137138    The type of object (always 'work')139140    default: work141142  - `id: string`143144    Work identifier (e.g., 'work_...')145146  - `acknowledged_at: string or null`147148    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox149150  - `created_at: string`151152    RFC 3339 timestamp when work was created153154  - `data: BetaSessionWorkData`155156    The actual work to be performed157158    - `type: "session"`159160      Type of work data161162    - `id: string`163164      Session identifier (e.g., 'session_...')165166  - `environment_id: string`167168    Environment identifier this work belongs to (e.g., `env_...`)169170  - `latest_heartbeat_at: string or null`171172    RFC 3339 timestamp of the most recent heartbeat173174  - `metadata: map[string]`175176    User-provided metadata key-value pairs associated with this work item177178  - `secret: string or null`179180    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.181182  - `started_at: string or null`183184    RFC 3339 timestamp when work execution started185186  - `state: "queued" or "starting" or "active" or 2 more`187188    Current state of the work item189190    - `"queued"`191192    - `"starting"`193194    - `"active"`195196    - `"stopping"`197198    - `"stopped"`199200  - `stop_requested_at: string or null`201202    RFC 3339 timestamp when stop was requested203204  - `stopped_at: string or null`205206    RFC 3339 timestamp when work execution stopped207208### Example209210```bash211curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID \212    -H 'anthropic-version: 2023-06-01' \213    -H 'anthropic-beta: managed-agents-2026-04-01' \214    -H "X-Api-Key: $ANTHROPIC_API_KEY"215```216217#### Response (200)218219```json220{221  "id": "id",222  "acknowledged_at": "acknowledged_at",223  "created_at": "created_at",224  "data": {225    "id": "id",226    "type": "session"227  },228  "environment_id": "environment_id",229  "latest_heartbeat_at": "latest_heartbeat_at",230  "metadata": {231    "foo": "string"232  },233  "secret": "secret",234  "started_at": "started_at",235  "state": "queued",236  "stop_requested_at": "stop_requested_at",237  "stopped_at": "stopped_at",238  "type": "work"239}240```241242## Poll for Work243244**GET** `/v1/environments/{environment_id}/work/poll`245246Note: 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.247248Long poll for work items in the queue.249250### Path parameters251252- `environment_id: string`253254### Query parameters255256- `block_ms: optional number`257258  How long to wait for work to arrive before returning. Must be 1-999 in milliseconds. Defaults to non-blocking (returns immediately if no work is available).259260  minimum: 1261262- `reclaim_older_than_ms: optional number`263264  Reclaim unacknowledged work items older than this many milliseconds. If omitted, uses the default (5000ms).265266  minimum: 1267268### Headers269270- `"anthropic-beta": optional array of AnthropicBeta`271272  Optional header to specify the beta version(s) you want to use.273274  - `string`275276  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`277278    - `"message-batches-2024-09-24"`279280    - `"prompt-caching-2024-07-31"`281282    - `"computer-use-2024-10-22"`283284    - `"computer-use-2025-01-24"`285286    - `"pdfs-2024-09-25"`287288    - `"token-counting-2024-11-01"`289290    - `"token-efficient-tools-2025-02-19"`291292    - `"output-128k-2025-02-19"`293294    - `"files-api-2025-04-14"`295296    - `"mcp-client-2025-04-04"`297298    - `"mcp-client-2025-11-20"`299300    - `"dev-full-thinking-2025-05-14"`301302    - `"interleaved-thinking-2025-05-14"`303304    - `"code-execution-2025-05-22"`305306    - `"extended-cache-ttl-2025-04-11"`307308    - `"context-1m-2025-08-07"`309310    - `"context-management-2025-06-27"`311312    - `"model-context-window-exceeded-2025-08-26"`313314    - `"skills-2025-10-02"`315316    - `"fast-mode-2026-02-01"`317318    - `"output-300k-2026-03-24"`319320    - `"user-profiles-2026-03-24"`321322    - `"user-profiles-2026-08-18"`323324    - `"user-profiles-2026-09-04"`325326    - `"advisor-tool-2026-03-01"`327328    - `"managed-agents-2026-04-01"`329330    - `"cache-diagnosis-2026-04-07"`331332    - `"dreaming-2026-04-21"`333334    - `"thinking-token-count-2026-05-13"`335336    - `"server-side-fallback-2026-06-01"`337338    - `"server-side-fallback-2026-07-01"`339340    - `"fallback-credit-2026-06-01"`341342    - `"fallback-credit-2026-07-01"`343344    - `"agent-memory-2026-07-22"`345346    - `"mid-conversation-tool-changes-2026-07-01"`347348    - `"compact-2026-01-12"`349350    - `"computer-use-2025-11-24"`351352    - `"mcp-tunnels-2026-06-22"`353354    - `"structured-outputs-2025-11-13"`355356    - `"task-budgets-2026-03-13"`357358    - `"thinking-display-updates-2026-08-18"`359360    - `"ce-user-management-2026-07-13"`361362    - `"mid-conversation-output-config-2026-07-01"`363364    - `"thinking-binding-controls-2026-08-01"`365366    - `"mid-conversation-system-clear-at-2026-08-21"`367368    - `"compact-2026-09-04"`369370- `"Anthropic-Worker-ID": optional string`371372  Unique identifier for the specific worker polling, used to track aggregated environment-level work metrics in Console373374### Returns375376- `BetaSelfHostedWork object`377378  Work resource representing a unit of work in a self-hosted environment.379380  Work items are queued when sessions are created or when long-dormant sessions381  receive new messages. The environment worker polls for work to execute in a382  self-hosted sandbox.383384  - `type: "work"`385386    The type of object (always 'work')387388    default: work389390  - `id: string`391392    Work identifier (e.g., 'work_...')393394  - `acknowledged_at: string or null`395396    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox397398  - `created_at: string`399400    RFC 3339 timestamp when work was created401402  - `data: BetaSessionWorkData`403404    The actual work to be performed405406    - `type: "session"`407408      Type of work data409410    - `id: string`411412      Session identifier (e.g., 'session_...')413414  - `environment_id: string`415416    Environment identifier this work belongs to (e.g., `env_...`)417418  - `latest_heartbeat_at: string or null`419420    RFC 3339 timestamp of the most recent heartbeat421422  - `metadata: map[string]`423424    User-provided metadata key-value pairs associated with this work item425426  - `secret: string or null`427428    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.429430  - `started_at: string or null`431432    RFC 3339 timestamp when work execution started433434  - `state: "queued" or "starting" or "active" or 2 more`435436    Current state of the work item437438    - `"queued"`439440    - `"starting"`441442    - `"active"`443444    - `"stopping"`445446    - `"stopped"`447448  - `stop_requested_at: string or null`449450    RFC 3339 timestamp when stop was requested451452  - `stopped_at: string or null`453454    RFC 3339 timestamp when work execution stopped455456### Example457458```bash459curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/poll \460    -H 'anthropic-version: 2023-06-01' \461    -H 'anthropic-beta: managed-agents-2026-04-01' \462    -H "X-Api-Key: $ANTHROPIC_API_KEY"463```464465#### Response (200)466467```json468{469  "id": "id",470  "acknowledged_at": "acknowledged_at",471  "created_at": "created_at",472  "data": {473    "id": "id",474    "type": "session"475  },476  "environment_id": "environment_id",477  "latest_heartbeat_at": "latest_heartbeat_at",478  "metadata": {479    "foo": "string"480  },481  "secret": "secret",482  "started_at": "started_at",483  "state": "queued",484  "stop_requested_at": "stop_requested_at",485  "stopped_at": "stopped_at",486  "type": "work"487}488```489490## Acknowledge Work491492**POST** `/v1/environments/{environment_id}/work/{work_id}/ack`493494Note: 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.495496Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' and removing it from the queue.497498### Path parameters499500- `environment_id: string`501502- `work_id: string`503504### Headers505506- `"anthropic-beta": optional array of AnthropicBeta`507508  Optional header to specify the beta version(s) you want to use.509510  - `string`511512  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`513514    - `"message-batches-2024-09-24"`515516    - `"prompt-caching-2024-07-31"`517518    - `"computer-use-2024-10-22"`519520    - `"computer-use-2025-01-24"`521522    - `"pdfs-2024-09-25"`523524    - `"token-counting-2024-11-01"`525526    - `"token-efficient-tools-2025-02-19"`527528    - `"output-128k-2025-02-19"`529530    - `"files-api-2025-04-14"`531532    - `"mcp-client-2025-04-04"`533534    - `"mcp-client-2025-11-20"`535536    - `"dev-full-thinking-2025-05-14"`537538    - `"interleaved-thinking-2025-05-14"`539540    - `"code-execution-2025-05-22"`541542    - `"extended-cache-ttl-2025-04-11"`543544    - `"context-1m-2025-08-07"`545546    - `"context-management-2025-06-27"`547548    - `"model-context-window-exceeded-2025-08-26"`549550    - `"skills-2025-10-02"`551552    - `"fast-mode-2026-02-01"`553554    - `"output-300k-2026-03-24"`555556    - `"user-profiles-2026-03-24"`557558    - `"user-profiles-2026-08-18"`559560    - `"user-profiles-2026-09-04"`561562    - `"advisor-tool-2026-03-01"`563564    - `"managed-agents-2026-04-01"`565566    - `"cache-diagnosis-2026-04-07"`567568    - `"dreaming-2026-04-21"`569570    - `"thinking-token-count-2026-05-13"`571572    - `"server-side-fallback-2026-06-01"`573574    - `"server-side-fallback-2026-07-01"`575576    - `"fallback-credit-2026-06-01"`577578    - `"fallback-credit-2026-07-01"`579580    - `"agent-memory-2026-07-22"`581582    - `"mid-conversation-tool-changes-2026-07-01"`583584    - `"compact-2026-01-12"`585586    - `"computer-use-2025-11-24"`587588    - `"mcp-tunnels-2026-06-22"`589590    - `"structured-outputs-2025-11-13"`591592    - `"task-budgets-2026-03-13"`593594    - `"thinking-display-updates-2026-08-18"`595596    - `"ce-user-management-2026-07-13"`597598    - `"mid-conversation-output-config-2026-07-01"`599600    - `"thinking-binding-controls-2026-08-01"`601602    - `"mid-conversation-system-clear-at-2026-08-21"`603604    - `"compact-2026-09-04"`605606### Returns607608- `BetaSelfHostedWork object`609610  Work resource representing a unit of work in a self-hosted environment.611612  Work items are queued when sessions are created or when long-dormant sessions613  receive new messages. The environment worker polls for work to execute in a614  self-hosted sandbox.615616  - `type: "work"`617618    The type of object (always 'work')619620    default: work621622  - `id: string`623624    Work identifier (e.g., 'work_...')625626  - `acknowledged_at: string or null`627628    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox629630  - `created_at: string`631632    RFC 3339 timestamp when work was created633634  - `data: BetaSessionWorkData`635636    The actual work to be performed637638    - `type: "session"`639640      Type of work data641642    - `id: string`643644      Session identifier (e.g., 'session_...')645646  - `environment_id: string`647648    Environment identifier this work belongs to (e.g., `env_...`)649650  - `latest_heartbeat_at: string or null`651652    RFC 3339 timestamp of the most recent heartbeat653654  - `metadata: map[string]`655656    User-provided metadata key-value pairs associated with this work item657658  - `secret: string or null`659660    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.661662  - `started_at: string or null`663664    RFC 3339 timestamp when work execution started665666  - `state: "queued" or "starting" or "active" or 2 more`667668    Current state of the work item669670    - `"queued"`671672    - `"starting"`673674    - `"active"`675676    - `"stopping"`677678    - `"stopped"`679680  - `stop_requested_at: string or null`681682    RFC 3339 timestamp when stop was requested683684  - `stopped_at: string or null`685686    RFC 3339 timestamp when work execution stopped687688### Example689690```bash691curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID/ack \692    -X POST \693    -H 'anthropic-version: 2023-06-01' \694    -H 'anthropic-beta: managed-agents-2026-04-01' \695    -H "X-Api-Key: $ANTHROPIC_API_KEY"696```697698#### Response (200)699700```json701{702  "id": "id",703  "acknowledged_at": "acknowledged_at",704  "created_at": "created_at",705  "data": {706    "id": "id",707    "type": "session"708  },709  "environment_id": "environment_id",710  "latest_heartbeat_at": "latest_heartbeat_at",711  "metadata": {712    "foo": "string"713  },714  "secret": "secret",715  "started_at": "started_at",716  "state": "queued",717  "stop_requested_at": "stop_requested_at",718  "stopped_at": "stopped_at",719  "type": "work"720}721```722723## Record Heartbeat724725**POST** `/v1/environments/{environment_id}/work/{work_id}/heartbeat`726727Note: 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.728729Record a heartbeat for a work item to maintain the lease.730731### Path parameters732733- `environment_id: string`734735- `work_id: string`736737### Query parameters738739- `desired_ttl_seconds: optional number`740741  Desired TTL in seconds742743- `expected_last_heartbeat: optional string`744745  Expected last_heartbeat for conditional update (optimistic concurrency). Use literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For subsequent heartbeats, echo the server's previous last_heartbeat value exactly. Returns 412 Precondition Failed if the actual value doesn't match.746747### Headers748749- `"anthropic-beta": optional array of AnthropicBeta`750751  Optional header to specify the beta version(s) you want to use.752753  - `string`754755  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`756757    - `"message-batches-2024-09-24"`758759    - `"prompt-caching-2024-07-31"`760761    - `"computer-use-2024-10-22"`762763    - `"computer-use-2025-01-24"`764765    - `"pdfs-2024-09-25"`766767    - `"token-counting-2024-11-01"`768769    - `"token-efficient-tools-2025-02-19"`770771    - `"output-128k-2025-02-19"`772773    - `"files-api-2025-04-14"`774775    - `"mcp-client-2025-04-04"`776777    - `"mcp-client-2025-11-20"`778779    - `"dev-full-thinking-2025-05-14"`780781    - `"interleaved-thinking-2025-05-14"`782783    - `"code-execution-2025-05-22"`784785    - `"extended-cache-ttl-2025-04-11"`786787    - `"context-1m-2025-08-07"`788789    - `"context-management-2025-06-27"`790791    - `"model-context-window-exceeded-2025-08-26"`792793    - `"skills-2025-10-02"`794795    - `"fast-mode-2026-02-01"`796797    - `"output-300k-2026-03-24"`798799    - `"user-profiles-2026-03-24"`800801    - `"user-profiles-2026-08-18"`802803    - `"user-profiles-2026-09-04"`804805    - `"advisor-tool-2026-03-01"`806807    - `"managed-agents-2026-04-01"`808809    - `"cache-diagnosis-2026-04-07"`810811    - `"dreaming-2026-04-21"`812813    - `"thinking-token-count-2026-05-13"`814815    - `"server-side-fallback-2026-06-01"`816817    - `"server-side-fallback-2026-07-01"`818819    - `"fallback-credit-2026-06-01"`820821    - `"fallback-credit-2026-07-01"`822823    - `"agent-memory-2026-07-22"`824825    - `"mid-conversation-tool-changes-2026-07-01"`826827    - `"compact-2026-01-12"`828829    - `"computer-use-2025-11-24"`830831    - `"mcp-tunnels-2026-06-22"`832833    - `"structured-outputs-2025-11-13"`834835    - `"task-budgets-2026-03-13"`836837    - `"thinking-display-updates-2026-08-18"`838839    - `"ce-user-management-2026-07-13"`840841    - `"mid-conversation-output-config-2026-07-01"`842843    - `"thinking-binding-controls-2026-08-01"`844845    - `"mid-conversation-system-clear-at-2026-08-21"`846847    - `"compact-2026-09-04"`848849### Returns850851- `BetaSelfHostedWorkHeartbeatResponse object`852853  Response after recording a heartbeat for a work item.854855  - `type: "work_heartbeat"`856857    The type of response858859    default: work_heartbeat860861  - `last_heartbeat: string`862863    RFC 3339 timestamp of the actual heartbeat from DB864865  - `lease_extended: boolean`866867    Whether the heartbeat succeeded in extending the lease868869  - `state: "queued" or "starting" or "active" or 2 more`870871    Current state of the work item (active/stopping/stopped)872873    - `"queued"`874875    - `"starting"`876877    - `"active"`878879    - `"stopping"`880881    - `"stopped"`882883  - `ttl_seconds: number`884885    Effective TTL applied to the lease886887### Example888889```bash890curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID/heartbeat \891    -X POST \892    -H 'anthropic-version: 2023-06-01' \893    -H 'anthropic-beta: managed-agents-2026-04-01' \894    -H "X-Api-Key: $ANTHROPIC_API_KEY"895```896897#### Response (200)898899```json900{901  "last_heartbeat": "last_heartbeat",902  "lease_extended": true,903  "state": "queued",904  "ttl_seconds": 0,905  "type": "work_heartbeat"906}907```908909## Stop Work910911**POST** `/v1/environments/{environment_id}/work/{work_id}/stop`912913Note: 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.914915Stop a work item, initiating graceful or forced shutdown.916917### Path parameters918919- `environment_id: string`920921- `work_id: string`922923### Headers924925- `"anthropic-beta": optional array of AnthropicBeta`926927  Optional header to specify the beta version(s) you want to use.928929  - `string`930931  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`932933    - `"message-batches-2024-09-24"`934935    - `"prompt-caching-2024-07-31"`936937    - `"computer-use-2024-10-22"`938939    - `"computer-use-2025-01-24"`940941    - `"pdfs-2024-09-25"`942943    - `"token-counting-2024-11-01"`944945    - `"token-efficient-tools-2025-02-19"`946947    - `"output-128k-2025-02-19"`948949    - `"files-api-2025-04-14"`950951    - `"mcp-client-2025-04-04"`952953    - `"mcp-client-2025-11-20"`954955    - `"dev-full-thinking-2025-05-14"`956957    - `"interleaved-thinking-2025-05-14"`958959    - `"code-execution-2025-05-22"`960961    - `"extended-cache-ttl-2025-04-11"`962963    - `"context-1m-2025-08-07"`964965    - `"context-management-2025-06-27"`966967    - `"model-context-window-exceeded-2025-08-26"`968969    - `"skills-2025-10-02"`970971    - `"fast-mode-2026-02-01"`972973    - `"output-300k-2026-03-24"`974975    - `"user-profiles-2026-03-24"`976977    - `"user-profiles-2026-08-18"`978979    - `"user-profiles-2026-09-04"`980981    - `"advisor-tool-2026-03-01"`982983    - `"managed-agents-2026-04-01"`984985    - `"cache-diagnosis-2026-04-07"`986987    - `"dreaming-2026-04-21"`988989    - `"thinking-token-count-2026-05-13"`990991    - `"server-side-fallback-2026-06-01"`992993    - `"server-side-fallback-2026-07-01"`994995    - `"fallback-credit-2026-06-01"`996997    - `"fallback-credit-2026-07-01"`998999    - `"agent-memory-2026-07-22"`10001001    - `"mid-conversation-tool-changes-2026-07-01"`10021003    - `"compact-2026-01-12"`10041005    - `"computer-use-2025-11-24"`10061007    - `"mcp-tunnels-2026-06-22"`10081009    - `"structured-outputs-2025-11-13"`10101011    - `"task-budgets-2026-03-13"`10121013    - `"thinking-display-updates-2026-08-18"`10141015    - `"ce-user-management-2026-07-13"`10161017    - `"mid-conversation-output-config-2026-07-01"`10181019    - `"thinking-binding-controls-2026-08-01"`10201021    - `"mid-conversation-system-clear-at-2026-08-21"`10221023    - `"compact-2026-09-04"`10241025- `"anthropic-workspace-id": optional string`10261027### Body parameters10281029- `force: optional boolean`10301031  If true, immediately stop work without graceful shutdown10321033  default: false10341035### Returns10361037- `BetaSelfHostedWork object`10381039  Work resource representing a unit of work in a self-hosted environment.10401041  Work items are queued when sessions are created or when long-dormant sessions1042  receive new messages. The environment worker polls for work to execute in a1043  self-hosted sandbox.10441045  - `type: "work"`10461047    The type of object (always 'work')10481049    default: work10501051  - `id: string`10521053    Work identifier (e.g., 'work_...')10541055  - `acknowledged_at: string or null`10561057    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox10581059  - `created_at: string`10601061    RFC 3339 timestamp when work was created10621063  - `data: BetaSessionWorkData`10641065    The actual work to be performed10661067    - `type: "session"`10681069      Type of work data10701071    - `id: string`10721073      Session identifier (e.g., 'session_...')10741075  - `environment_id: string`10761077    Environment identifier this work belongs to (e.g., `env_...`)10781079  - `latest_heartbeat_at: string or null`10801081    RFC 3339 timestamp of the most recent heartbeat10821083  - `metadata: map[string]`10841085    User-provided metadata key-value pairs associated with this work item10861087  - `secret: string or null`10881089    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.10901091  - `started_at: string or null`10921093    RFC 3339 timestamp when work execution started10941095  - `state: "queued" or "starting" or "active" or 2 more`10961097    Current state of the work item10981099    - `"queued"`11001101    - `"starting"`11021103    - `"active"`11041105    - `"stopping"`11061107    - `"stopped"`11081109  - `stop_requested_at: string or null`11101111    RFC 3339 timestamp when stop was requested11121113  - `stopped_at: string or null`11141115    RFC 3339 timestamp when work execution stopped11161117### Example11181119```bash1120curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID/stop \1121    -H 'Content-Type: application/json' \1122    -H 'anthropic-version: 2023-06-01' \1123    -H 'anthropic-beta: managed-agents-2026-04-01' \1124    -H "X-Api-Key: $ANTHROPIC_API_KEY" \1125    -d '{}'1126```11271128#### Response (200)11291130```json1131{1132  "id": "id",1133  "acknowledged_at": "acknowledged_at",1134  "created_at": "created_at",1135  "data": {1136    "id": "id",1137    "type": "session"1138  },1139  "environment_id": "environment_id",1140  "latest_heartbeat_at": "latest_heartbeat_at",1141  "metadata": {1142    "foo": "string"1143  },1144  "secret": "secret",1145  "started_at": "started_at",1146  "state": "queued",1147  "stop_requested_at": "stop_requested_at",1148  "stopped_at": "stopped_at",1149  "type": "work"1150}1151```11521153## List Work Items11541155**GET** `/v1/environments/{environment_id}/work`11561157Note: 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.11581159List work items in an environment.11601161### Path parameters11621163- `environment_id: string`11641165### Query parameters11661167- `limit: optional number`11681169  Maximum number of work items to return11701171  default: 20, maximum: 1000, minimum: 111721173- `page: optional string`11741175  Opaque cursor from previous response for pagination11761177### Headers11781179- `"anthropic-beta": optional array of AnthropicBeta`11801181  Optional header to specify the beta version(s) you want to use.11821183  - `string`11841185  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`11861187    - `"message-batches-2024-09-24"`11881189    - `"prompt-caching-2024-07-31"`11901191    - `"computer-use-2024-10-22"`11921193    - `"computer-use-2025-01-24"`11941195    - `"pdfs-2024-09-25"`11961197    - `"token-counting-2024-11-01"`11981199    - `"token-efficient-tools-2025-02-19"`12001201    - `"output-128k-2025-02-19"`12021203    - `"files-api-2025-04-14"`12041205    - `"mcp-client-2025-04-04"`12061207    - `"mcp-client-2025-11-20"`12081209    - `"dev-full-thinking-2025-05-14"`12101211    - `"interleaved-thinking-2025-05-14"`12121213    - `"code-execution-2025-05-22"`12141215    - `"extended-cache-ttl-2025-04-11"`12161217    - `"context-1m-2025-08-07"`12181219    - `"context-management-2025-06-27"`12201221    - `"model-context-window-exceeded-2025-08-26"`12221223    - `"skills-2025-10-02"`12241225    - `"fast-mode-2026-02-01"`12261227    - `"output-300k-2026-03-24"`12281229    - `"user-profiles-2026-03-24"`12301231    - `"user-profiles-2026-08-18"`12321233    - `"user-profiles-2026-09-04"`12341235    - `"advisor-tool-2026-03-01"`12361237    - `"managed-agents-2026-04-01"`12381239    - `"cache-diagnosis-2026-04-07"`12401241    - `"dreaming-2026-04-21"`12421243    - `"thinking-token-count-2026-05-13"`12441245    - `"server-side-fallback-2026-06-01"`12461247    - `"server-side-fallback-2026-07-01"`12481249    - `"fallback-credit-2026-06-01"`12501251    - `"fallback-credit-2026-07-01"`12521253    - `"agent-memory-2026-07-22"`12541255    - `"mid-conversation-tool-changes-2026-07-01"`12561257    - `"compact-2026-01-12"`12581259    - `"computer-use-2025-11-24"`12601261    - `"mcp-tunnels-2026-06-22"`12621263    - `"structured-outputs-2025-11-13"`12641265    - `"task-budgets-2026-03-13"`12661267    - `"thinking-display-updates-2026-08-18"`12681269    - `"ce-user-management-2026-07-13"`12701271    - `"mid-conversation-output-config-2026-07-01"`12721273    - `"thinking-binding-controls-2026-08-01"`12741275    - `"mid-conversation-system-clear-at-2026-08-21"`12761277    - `"compact-2026-09-04"`12781279### Returns12801281- `BetaSelfHostedWorkListResponse object`12821283  Response when listing work items with cursor-based pagination.12841285  - `data: array of BetaSelfHostedWork`12861287    List of work items12881289    - `type: "work"`12901291      The type of object (always 'work')12921293      default: work12941295    - `id: string`12961297      Work identifier (e.g., 'work_...')12981299    - `acknowledged_at: string or null`13001301      RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox13021303    - `created_at: string`13041305      RFC 3339 timestamp when work was created13061307    - `data: BetaSessionWorkData`13081309      The actual work to be performed13101311      - `type: "session"`13121313        Type of work data13141315      - `id: string`13161317        Session identifier (e.g., 'session_...')13181319    - `environment_id: string`13201321      Environment identifier this work belongs to (e.g., `env_...`)13221323    - `latest_heartbeat_at: string or null`13241325      RFC 3339 timestamp of the most recent heartbeat13261327    - `metadata: map[string]`13281329      User-provided metadata key-value pairs associated with this work item13301331    - `secret: string or null`13321333      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.13341335    - `started_at: string or null`13361337      RFC 3339 timestamp when work execution started13381339    - `state: "queued" or "starting" or "active" or 2 more`13401341      Current state of the work item13421343      - `"queued"`13441345      - `"starting"`13461347      - `"active"`13481349      - `"stopping"`13501351      - `"stopped"`13521353    - `stop_requested_at: string or null`13541355      RFC 3339 timestamp when stop was requested13561357    - `stopped_at: string or null`13581359      RFC 3339 timestamp when work execution stopped13601361  - `next_page: string or null`13621363    Opaque cursor for fetching the next page of results13641365### Example13661367```bash1368curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work \1369    -H 'anthropic-version: 2023-06-01' \1370    -H 'anthropic-beta: managed-agents-2026-04-01' \1371    -H "X-Api-Key: $ANTHROPIC_API_KEY"1372```13731374#### Response (200)13751376```json1377{1378  "data": [1379    {1380      "id": "id",1381      "acknowledged_at": "acknowledged_at",1382      "created_at": "created_at",1383      "data": {1384        "id": "id",1385        "type": "session"1386      },1387      "environment_id": "environment_id",1388      "latest_heartbeat_at": "latest_heartbeat_at",1389      "metadata": {1390        "foo": "string"1391      },1392      "secret": "secret",1393      "started_at": "started_at",1394      "state": "queued",1395      "stop_requested_at": "stop_requested_at",1396      "stopped_at": "stopped_at",1397      "type": "work"1398    }1399  ],1400  "next_page": "next_page"1401}1402```14031404## Update Work Item14051406**POST** `/v1/environments/{environment_id}/work/{work_id}`14071408Note: 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.14091410Update work item metadata with merge semantics.14111412### Path parameters14131414- `environment_id: string`14151416- `work_id: string`14171418### Headers14191420- `"anthropic-beta": optional array of AnthropicBeta`14211422  Optional header to specify the beta version(s) you want to use.14231424  - `string`14251426  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`14271428    - `"message-batches-2024-09-24"`14291430    - `"prompt-caching-2024-07-31"`14311432    - `"computer-use-2024-10-22"`14331434    - `"computer-use-2025-01-24"`14351436    - `"pdfs-2024-09-25"`14371438    - `"token-counting-2024-11-01"`14391440    - `"token-efficient-tools-2025-02-19"`14411442    - `"output-128k-2025-02-19"`14431444    - `"files-api-2025-04-14"`14451446    - `"mcp-client-2025-04-04"`14471448    - `"mcp-client-2025-11-20"`14491450    - `"dev-full-thinking-2025-05-14"`14511452    - `"interleaved-thinking-2025-05-14"`14531454    - `"code-execution-2025-05-22"`14551456    - `"extended-cache-ttl-2025-04-11"`14571458    - `"context-1m-2025-08-07"`14591460    - `"context-management-2025-06-27"`14611462    - `"model-context-window-exceeded-2025-08-26"`14631464    - `"skills-2025-10-02"`14651466    - `"fast-mode-2026-02-01"`14671468    - `"output-300k-2026-03-24"`14691470    - `"user-profiles-2026-03-24"`14711472    - `"user-profiles-2026-08-18"`14731474    - `"user-profiles-2026-09-04"`14751476    - `"advisor-tool-2026-03-01"`14771478    - `"managed-agents-2026-04-01"`14791480    - `"cache-diagnosis-2026-04-07"`14811482    - `"dreaming-2026-04-21"`14831484    - `"thinking-token-count-2026-05-13"`14851486    - `"server-side-fallback-2026-06-01"`14871488    - `"server-side-fallback-2026-07-01"`14891490    - `"fallback-credit-2026-06-01"`14911492    - `"fallback-credit-2026-07-01"`14931494    - `"agent-memory-2026-07-22"`14951496    - `"mid-conversation-tool-changes-2026-07-01"`14971498    - `"compact-2026-01-12"`14991500    - `"computer-use-2025-11-24"`15011502    - `"mcp-tunnels-2026-06-22"`15031504    - `"structured-outputs-2025-11-13"`15051506    - `"task-budgets-2026-03-13"`15071508    - `"thinking-display-updates-2026-08-18"`15091510    - `"ce-user-management-2026-07-13"`15111512    - `"mid-conversation-output-config-2026-07-01"`15131514    - `"thinking-binding-controls-2026-08-01"`15151516    - `"mid-conversation-system-clear-at-2026-08-21"`15171518    - `"compact-2026-09-04"`15191520- `"anthropic-workspace-id": optional string`15211522### Body parameters15231524- `metadata: map[string]`15251526  Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve existing metadata.15271528### Returns15291530- `BetaSelfHostedWork object`15311532  Work resource representing a unit of work in a self-hosted environment.15331534  Work items are queued when sessions are created or when long-dormant sessions1535  receive new messages. The environment worker polls for work to execute in a1536  self-hosted sandbox.15371538  - `type: "work"`15391540    The type of object (always 'work')15411542    default: work15431544  - `id: string`15451546    Work identifier (e.g., 'work_...')15471548  - `acknowledged_at: string or null`15491550    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox15511552  - `created_at: string`15531554    RFC 3339 timestamp when work was created15551556  - `data: BetaSessionWorkData`15571558    The actual work to be performed15591560    - `type: "session"`15611562      Type of work data15631564    - `id: string`15651566      Session identifier (e.g., 'session_...')15671568  - `environment_id: string`15691570    Environment identifier this work belongs to (e.g., `env_...`)15711572  - `latest_heartbeat_at: string or null`15731574    RFC 3339 timestamp of the most recent heartbeat15751576  - `metadata: map[string]`15771578    User-provided metadata key-value pairs associated with this work item15791580  - `secret: string or null`15811582    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.15831584  - `started_at: string or null`15851586    RFC 3339 timestamp when work execution started15871588  - `state: "queued" or "starting" or "active" or 2 more`15891590    Current state of the work item15911592    - `"queued"`15931594    - `"starting"`15951596    - `"active"`15971598    - `"stopping"`15991600    - `"stopped"`16011602  - `stop_requested_at: string or null`16031604    RFC 3339 timestamp when stop was requested16051606  - `stopped_at: string or null`16071608    RFC 3339 timestamp when work execution stopped16091610### Example16111612```bash1613curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/$WORK_ID \1614    -H 'Content-Type: application/json' \1615    -H 'anthropic-version: 2023-06-01' \1616    -H 'anthropic-beta: managed-agents-2026-04-01' \1617    -H "X-Api-Key: $ANTHROPIC_API_KEY" \1618    -d '{1619          "metadata": {1620            "foo": "string"1621          }1622        }'1623```16241625#### Response (200)16261627```json1628{1629  "id": "id",1630  "acknowledged_at": "acknowledged_at",1631  "created_at": "created_at",1632  "data": {1633    "id": "id",1634    "type": "session"1635  },1636  "environment_id": "environment_id",1637  "latest_heartbeat_at": "latest_heartbeat_at",1638  "metadata": {1639    "foo": "string"1640  },1641  "secret": "secret",1642  "started_at": "started_at",1643  "state": "queued",1644  "stop_requested_at": "stop_requested_at",1645  "stopped_at": "stopped_at",1646  "type": "work"1647}1648```16491650## Get Queue Statistics16511652**GET** `/v1/environments/{environment_id}/work/stats`16531654Get statistics about the work queue for an environment.16551656### Path parameters16571658- `environment_id: string`16591660### Headers16611662- `"anthropic-beta": optional array of AnthropicBeta`16631664  Optional header to specify the beta version(s) you want to use.16651666  - `string`16671668  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`16691670    - `"message-batches-2024-09-24"`16711672    - `"prompt-caching-2024-07-31"`16731674    - `"computer-use-2024-10-22"`16751676    - `"computer-use-2025-01-24"`16771678    - `"pdfs-2024-09-25"`16791680    - `"token-counting-2024-11-01"`16811682    - `"token-efficient-tools-2025-02-19"`16831684    - `"output-128k-2025-02-19"`16851686    - `"files-api-2025-04-14"`16871688    - `"mcp-client-2025-04-04"`16891690    - `"mcp-client-2025-11-20"`16911692    - `"dev-full-thinking-2025-05-14"`16931694    - `"interleaved-thinking-2025-05-14"`16951696    - `"code-execution-2025-05-22"`16971698    - `"extended-cache-ttl-2025-04-11"`16991700    - `"context-1m-2025-08-07"`17011702    - `"context-management-2025-06-27"`17031704    - `"model-context-window-exceeded-2025-08-26"`17051706    - `"skills-2025-10-02"`17071708    - `"fast-mode-2026-02-01"`17091710    - `"output-300k-2026-03-24"`17111712    - `"user-profiles-2026-03-24"`17131714    - `"user-profiles-2026-08-18"`17151716    - `"user-profiles-2026-09-04"`17171718    - `"advisor-tool-2026-03-01"`17191720    - `"managed-agents-2026-04-01"`17211722    - `"cache-diagnosis-2026-04-07"`17231724    - `"dreaming-2026-04-21"`17251726    - `"thinking-token-count-2026-05-13"`17271728    - `"server-side-fallback-2026-06-01"`17291730    - `"server-side-fallback-2026-07-01"`17311732    - `"fallback-credit-2026-06-01"`17331734    - `"fallback-credit-2026-07-01"`17351736    - `"agent-memory-2026-07-22"`17371738    - `"mid-conversation-tool-changes-2026-07-01"`17391740    - `"compact-2026-01-12"`17411742    - `"computer-use-2025-11-24"`17431744    - `"mcp-tunnels-2026-06-22"`17451746    - `"structured-outputs-2025-11-13"`17471748    - `"task-budgets-2026-03-13"`17491750    - `"thinking-display-updates-2026-08-18"`17511752    - `"ce-user-management-2026-07-13"`17531754    - `"mid-conversation-output-config-2026-07-01"`17551756    - `"thinking-binding-controls-2026-08-01"`17571758    - `"mid-conversation-system-clear-at-2026-08-21"`17591760    - `"compact-2026-09-04"`17611762- `"anthropic-workspace-id": optional string`17631764### Returns17651766- `BetaSelfHostedWorkQueueStats object`17671768  Statistics about the work queue for an environment.17691770  Uses Redis Stream consumer group metrics for O(1) queries.17711772  - `type: "work_queue_stats"`17731774    The type of object17751776    default: work_queue_stats17771778  - `depth: number`17791780    Number of work items waiting to be picked up (lag from consumer group)17811782  - `oldest_queued_at: string or null`17831784    RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty17851786  - `pending: number`17871788    Number of work items being processed (polled but not acknowledged)17891790    default: 017911792  - `workers_polling: number or null`17931794    Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.17951796### Example17971798```bash1799curl https://api.anthropic.com/v1/environments/$ENVIRONMENT_ID/work/stats \1800    -H 'anthropic-version: 2023-06-01' \1801    -H 'anthropic-beta: managed-agents-2026-04-01' \1802    -H "X-Api-Key: $ANTHROPIC_API_KEY"1803```18041805#### Response (200)18061807```json1808{1809  "depth": 0,1810  "oldest_queued_at": "oldest_queued_at",1811  "pending": 0,1812  "type": "work_queue_stats",1813  "workers_polling": 01814}1815```18161817## Domain types18181819### Beta Self Hosted Work18201821- `BetaSelfHostedWork object`18221823  Work resource representing a unit of work in a self-hosted environment.18241825  Work items are queued when sessions are created or when long-dormant sessions1826  receive new messages. The environment worker polls for work to execute in a1827  self-hosted sandbox.18281829  - `type: "work"`18301831    The type of object (always 'work')18321833    default: work18341835  - `id: string`18361837    Work identifier (e.g., 'work_...')18381839  - `acknowledged_at: string or null`18401841    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox18421843  - `created_at: string`18441845    RFC 3339 timestamp when work was created18461847  - `data: BetaSessionWorkData`18481849    The actual work to be performed18501851    - `type: "session"`18521853      Type of work data18541855    - `id: string`18561857      Session identifier (e.g., 'session_...')18581859  - `environment_id: string`18601861    Environment identifier this work belongs to (e.g., `env_...`)18621863  - `latest_heartbeat_at: string or null`18641865    RFC 3339 timestamp of the most recent heartbeat18661867  - `metadata: map[string]`18681869    User-provided metadata key-value pairs associated with this work item18701871  - `secret: string or null`18721873    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.18741875  - `started_at: string or null`18761877    RFC 3339 timestamp when work execution started18781879  - `state: "queued" or "starting" or "active" or 2 more`18801881    Current state of the work item18821883    - `"queued"`18841885    - `"starting"`18861887    - `"active"`18881889    - `"stopping"`18901891    - `"stopped"`18921893  - `stop_requested_at: string or null`18941895    RFC 3339 timestamp when stop was requested18961897  - `stopped_at: string or null`18981899    RFC 3339 timestamp when work execution stopped19001901### Beta Self Hosted Work Heartbeat Response19021903- `BetaSelfHostedWorkHeartbeatResponse object`19041905  Response after recording a heartbeat for a work item.19061907  - `type: "work_heartbeat"`19081909    The type of response19101911    default: work_heartbeat19121913  - `last_heartbeat: string`19141915    RFC 3339 timestamp of the actual heartbeat from DB19161917  - `lease_extended: boolean`19181919    Whether the heartbeat succeeded in extending the lease19201921  - `state: "queued" or "starting" or "active" or 2 more`19221923    Current state of the work item (active/stopping/stopped)19241925    - `"queued"`19261927    - `"starting"`19281929    - `"active"`19301931    - `"stopping"`19321933    - `"stopped"`19341935  - `ttl_seconds: number`19361937    Effective TTL applied to the lease19381939### Beta Self Hosted Work List Response19401941- `BetaSelfHostedWorkListResponse object`19421943  Response when listing work items with cursor-based pagination.19441945  - `data: array of BetaSelfHostedWork`19461947    List of work items19481949    - `type: "work"`19501951      The type of object (always 'work')19521953      default: work19541955    - `id: string`19561957      Work identifier (e.g., 'work_...')19581959    - `acknowledged_at: string or null`19601961      RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox19621963    - `created_at: string`19641965      RFC 3339 timestamp when work was created19661967    - `data: BetaSessionWorkData`19681969      The actual work to be performed19701971      - `type: "session"`19721973        Type of work data19741975      - `id: string`19761977        Session identifier (e.g., 'session_...')19781979    - `environment_id: string`19801981      Environment identifier this work belongs to (e.g., `env_...`)19821983    - `latest_heartbeat_at: string or null`19841985      RFC 3339 timestamp of the most recent heartbeat19861987    - `metadata: map[string]`19881989      User-provided metadata key-value pairs associated with this work item19901991    - `secret: string or null`19921993      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.19941995    - `started_at: string or null`19961997      RFC 3339 timestamp when work execution started19981999    - `state: "queued" or "starting" or "active" or 2 more`20002001      Current state of the work item20022003      - `"queued"`20042005      - `"starting"`20062007      - `"active"`20082009      - `"stopping"`20102011      - `"stopped"`20122013    - `stop_requested_at: string or null`20142015      RFC 3339 timestamp when stop was requested20162017    - `stopped_at: string or null`20182019      RFC 3339 timestamp when work execution stopped20202021  - `next_page: string or null`20222023    Opaque cursor for fetching the next page of results20242025### Beta Self Hosted Work Queue Stats20262027- `BetaSelfHostedWorkQueueStats object`20282029  Statistics about the work queue for an environment.20302031  Uses Redis Stream consumer group metrics for O(1) queries.20322033  - `type: "work_queue_stats"`20342035    The type of object20362037    default: work_queue_stats20382039  - `depth: number`20402041    Number of work items waiting to be picked up (lag from consumer group)20422043  - `oldest_queued_at: string or null`20442045    RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty20462047  - `pending: number`20482049    Number of work items being processed (polled but not acknowledged)20502051    default: 020522053  - `workers_polling: number or null`20542055    Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.20562057### Beta Self Hosted Work Stop Request20582059- `BetaSelfHostedWorkStopRequest object`20602061  Request to stop a work item.20622063  - `force: optional boolean`20642065    If true, immediately stop work without graceful shutdown20662067    default: false20682069### Beta Self Hosted Work Update Request20702071- `BetaSelfHostedWorkUpdateRequest object`20722073  Request to update work item metadata.20742075  - `metadata: map[string]`20762077    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve existing metadata.20782079### Beta Session Work Data20802081- `BetaSessionWorkData object`20822083  Work data for session work items.20842085  This resource type is used when work represents a session that needs to be executed2086  in a self-hosted environment.20872088  - `type: "session"`20892090    Type of work data20912092  - `id: string`20932094    Session identifier (e.g., 'session_...')2095
Files main
Menu

Theme