Work changedapi/beta/environments/work
Nearest release: v2.1.328, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+114added
Lines−2removed
From line
255
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits25to this page, all time
### Errors ### Errors ### Errors ### Errors ### Errors ## Errors ### heartbeat_precondition_failed
The whole hunk
from line 255, old and new numbered
/
from line 255
255255
256256 RFC 3339 timestamp when work execution stopped
257257
258### Errors
259
260Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
261
262Each code below is the value of `error.details.error_code` in the response body.
263
264- `claude_code_key_creator_not_member` (HTTP status 400)
265
266 The API key belongs to the Claude Code workspace, and the user who created it is no longer a member of the organization or of that workspace.
267
268- `organization_on_hold` (HTTP status 400)
269
270 Anthropic has disabled the organization for trust and safety reasons. An organization disabled for any other reason, such as billing, does not get this code. `appeal_url`, when present, is where the organization can appeal.
271
258272### Example
259273
260274```bash
from line 1086
10721086
10731087 Effective TTL applied to the lease
10741088
1089### Errors
1090
1091Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
1092
1093Each code below is the value of `error.details.error_code` in the response body.
1094
1095- `heartbeat_precondition_failed` (HTTP status 412)
1096
1097 `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease.
1098
10751099### Example
10761100
10771101```bash
from line 1376
13521376
13531377 RFC 3339 timestamp when work execution stopped
13541378
1379### Errors
1380
1381Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
1382
1383Each code below is the value of `error.details.error_code` in the response body.
1384
1385- `claude_code_key_creator_not_member` (HTTP status 400)
1386
1387 The API key belongs to the Claude Code workspace, and the user who created it is no longer a member of the organization or of that workspace.
1388
1389- `organization_on_hold` (HTTP status 400)
1390
1391 Anthropic has disabled the organization for trust and safety reasons. An organization disabled for any other reason, such as billing, does not get this code. `appeal_url`, when present, is where the organization can appeal.
1392
13551393### Example
13561394
13571395```bash
from line 1979
19411979
19421980 RFC 3339 timestamp when work execution stopped
19431981
1982### Errors
1983
1984Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
1985
1986Each code below is the value of `error.details.error_code` in the response body.
1987
1988- `claude_code_key_creator_not_member` (HTTP status 400)
1989
1990 The API key belongs to the Claude Code workspace, and the user who created it is no longer a member of the organization or of that workspace.
1991
1992- `invalid_metadata` (HTTP status 400)
1993
1994 `metadata` has too many keys, a key or value that is too long, or a reserved key. The message names each problem.
1995
1996- `organization_on_hold` (HTTP status 400)
1997
1998 Anthropic has disabled the organization for trust and safety reasons. An organization disabled for any other reason, such as billing, does not get this code. `appeal_url`, when present, is where the organization can appeal.
1999
19442000### Example
19452001
19462002```bash
from line 2231
21752231
21762232 Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.
21772233
2234### Errors
2235
2236Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=http).
2237
2238Each code below is the value of `error.details.error_code` in the response body.
2239
2240- `claude_code_key_creator_not_member` (HTTP status 400)
2241
2242 The API key belongs to the Claude Code workspace, and the user who created it is no longer a member of the organization or of that workspace.
2243
2244- `organization_on_hold` (HTTP status 400)
2245
2246 Anthropic has disabled the organization for trust and safety reasons. An organization disabled for any other reason, such as billing, does not get this code. `appeal_url`, when present, is where the organization can appeal.
2247
21782248### Example
21792249
21802250```bash
from line 2272
22022272
22032273- `BetaHeartbeatPreconditionFailedErrorDetails object`
22042274
2205 `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease.
2206
22072275 - `current_state: BetaWorkLeaseState`
22082276
22092277 The lease as the server holds it.
from line 2610
25422610 - `ttl_seconds: number`
25432611
25442612 TTL of the lease
2613
2614## Errors
2615
2616### heartbeat_precondition_failed
2617
2618HTTP status 412
2619
2620- `"heartbeat_precondition_failed"`
2621
2622 `expected_last_heartbeat` does not match the stored heartbeat, so another worker may hold the lease.
2623
2624 - `details: BetaHeartbeatPreconditionFailedErrorDetails`
2625
2626 - `current_state: BetaWorkLeaseState`
2627
2628 The lease as the server holds it.
2629
2630 - `last_heartbeat: string or null`
2631
2632 RFC 3339 timestamp of the stored heartbeat, or null if there has been none
2633
2634 - `lease_extended: boolean`
2635
2636 Always false: a refused heartbeat does not extend the lease
2637
2638 - `state: "queued" or "starting" or "active" or 2 more`
2639
2640 Current state of the work item
2641
2642 - `"queued"`
2643
2644 - `"starting"`
2645
2646 - `"active"`
2647
2648 - `"stopping"`
2649
2650 - `"stopped"`
2651
2652 - `ttl_seconds: number`
2653
2654 TTL of the lease
2655
2656 - `error_code: "heartbeat_precondition_failed"`
25452657
No line in this hunk matches that.