---
title: dots.v2.harnessRuntime.sessions.bySession_id().workspace.upload.post()
description: Upload a file or tar archive into the session&#39;s sandbox workspace.
product: Reference
url: https://docs.digitalocean.com/reference/dots/reference/harness-runtime/harness-create-session-workspace-upload/
last_updated: "2026-11-18"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# dots.v2.harnessRuntime.sessions.bySession_id().workspace.upload.post()

Generated on 18 Nov 2026 from DoTs version [`v1.25.0`](https://github.com/digitalocean/dots/releases/tag/v1.25.0)

## Usage

```typescript
client.v2.harnessRuntime.sessions.bySession_id(session_id).workspace.upload.post(body: undefined | ArrayBuffer, requestConfiguration?: RequestConfiguration<UploadRequestBuilderPostQueryParameters>): Promise<undefined | Workspace_upload_response>
```

## Description

Streams the raw request body to a path inside the sandbox workspace. Concurrent transfers (upload + download) are capped server-side; over the cap the request blocks and may return 503. The optional `X-Content-Sha256` request header carries a hex digest the guest verifies after the full payload is written.

## Parameters

### Path Parameters

`session_id` string required

Example: `a1b2c3d4-e5f6-7890-abcd-ef1234567890`

The session UUID.

### Query Parameters

`path` string required

Example: `example`

Destination path inside the sandbox workspace. Relative paths resolve under the workspace root; paths that escape the workspace are rejected. Required.

`isArchive` boolean optional

Example: `true`

If true, the body is a tar stream that the guest extracts under `path`. Defaults to false (single file).

### Headers

`X-Content-Sha256` string optional

Example: `example`

Optional hex SHA-256 of the full payload. The guest verifies it after writing; a mismatch returns 400.

### Request Body

The request body uses `application/octet-stream`.

`body` string required

Example: `example`

## Response Example

## Show Response Example

```json
{
  "path": "example",
  "bytes_written": 1
}
```

## More Information

See [`/v2/harness-runtime/sessions/{session_id}/workspace/upload`](https://docs.digitalocean.com/reference/api/reference/harness-runtime/index.html.md#harness_create_session_workspace_upload) in the API reference for additional detail on responses, headers, parameters, and more.