> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Session Object

Upload an object to the session storage.

## **POST** `/revisions/:id/data/command` (Command: `upload_session_object`)

### Request Body

| Parameter    | Type   | Required | Description                      |
| :----------- | :----- | :------- | :------------------------------- |
| `engine`     | string | Yes      | Must be `workflow_blobhub`.      |
| `command`    | string | Yes      | Must be `upload_session_object`. |
| `session_id` | string | Yes      | The ID of the session.           |
| `alias`      | string | Yes      | Unique alias for the object.     |
| `value`      | object | Yes      | The JSON object to store.        |

### Response

Returns an empty JSON object upon success.

> When `value.type` is `"thread"`, this command creates or updates the thread envelope only. Items
> are appended via `post_session_thread_item`. Deleting the envelope cascades and removes all items.

> When `value.type` is `"graph"`, this command creates or updates the graph envelope only. Elements
> (vertices and edges) are managed via the six graph commands. Deleting the envelope cascades and
> removes all elements. See the [graph session object](/blob-types/workflow/session-objects/graph/introduction) for the
> envelope and element schema.

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "workflow_blobhub",
    "command": "upload_session_object",
    "session_id": "sess_001",
    "alias": "config",
    "value": { "debug": true }
  }
  ```

  ```json Response theme={null}
  {}
  ```
</CodeGroup>

### See also

* [BlobHub Worker — thread handoff](/worker/session-agent-harness/thread-handoff) — set
  `workspace.agent_type`, `workspace.work_folder`, and `agent.state = "pending"` on a thread
  envelope to hand it off to a BlobHub Worker.
* [BlobHub Worker — the `worker` session object](/worker/session-agent-harness/worker-object) — the
  worker uploads a `worker`-aliased session object as its per-session affinity lock and activity log.
