Update Work Item
POST/v1/environments/{environment_id}/work/{work_id}
Update work item metadata with merge semantics.
This endpoint accepts a Claude API key. It rejects the environment key and the work item's secret. On Claude Platform on AWS or Claude Models on Google Cloud (Anthropic managed), use that platform's credentials instead.
Update Work Item
require "anthropic"
anthropic = Anthropic::Client.new(api_key: "my-anthropic-api-key")
beta_self_hosted_work = anthropic.beta.environments.work.update(
"work_id",
environment_id: "env_011CZkZ9X2dpNyB7HsEFoRfW",
metadata: {foo: "string"}
)
puts(beta_self_hosted_work)Response 200
{
"id": "id",
"acknowledged_at": "acknowledged_at",
"created_at": "created_at",
"data": {
"id": "id",
"type": "session"
},
"environment_id": "environment_id",
"latest_heartbeat_at": "latest_heartbeat_at",
"metadata": {
"foo": "string"
},
"secret": "secret",
"started_at": "started_at",
"state": "queued",
"stop_requested_at": "stop_requested_at",
"stopped_at": "stopped_at",
"type": "work"
}Returns Examples
Response 200
{
"id": "id",
"acknowledged_at": "acknowledged_at",
"created_at": "created_at",
"data": {
"id": "id",
"type": "session"
},
"environment_id": "environment_id",
"latest_heartbeat_at": "latest_heartbeat_at",
"metadata": {
"foo": "string"
},
"secret": "secret",
"started_at": "started_at",
"state": "queued",
"stop_requested_at": "stop_requested_at",
"stopped_at": "stopped_at",
"type": "work"
}