# Update worker run session

```http
PUT /agent-workers/workers/{worker_id}/runs/{run_id}/session
```

Record worker session state.

## Parameters

| Name        | In   | Required | Description |
| ----------- | ---- | -------- | ----------- |
| `worker_id` | path | Yes      |             |
| `run_id`    | path | Yes      |             |

## Request body

| Field         | Type        | Required | Description |
| ------------- | ----------- | -------- | ----------- |
| `session_key` | string      | Yes      |             |
| `status`      | string      |          |             |
| `metadata`    | object,null |          |             |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | Worker session metadata created or updated for the worker-owned run.                                        |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
