dots.v2.agents.sessions.bySession_id().workspace.transfers.post()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.agents.sessions.bySession_id(session_id).workspace.transfers.post(body: TransfersPostRequestBody, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Workspace_transfer_created>

Description

Creates an asynchronous, object-storage-backed transfer for payloads larger than the streaming path supports (> ~50 MiB). Bulk bytes never traverse harness-api: the client PUTs/GETs presigned DO Spaces URLs directly.

Set direction to upload or download.

  • upload: responds 201 with transfer_id + part_size; the client then requests per-part presigned PUT URLs, uploads them to Spaces, and calls commit.
  • download: responds 202 with transfer_id; the client polls GET until completed and then fetches download_url from Spaces.

Upload, download, and cancel are live.

Parameters

Path Parameters

session_id string required

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

The session UUID.

Request Body

direction string required

Transfer direction.

One of: upload, download

path string required

Example: example

Workspace-relative path. Destination for upload, source for download. Paths that escape the workspace root are rejected.

isArchive boolean optional

Example: true

Upload only. When true, the payload is a tar the guest extracts at path.

asArchive boolean optional

Example: true

Download only. When true, path is exported as a tar stream.

sizeBytes integer optional

Example: 4

Optional total payload size, as a JSON number. Validated against the maximum staged object size (50 GiB); a larger value returns 413.

sha256 string optional

Example: example

Optional lowercase hex SHA-256 of the full payload. If set on an upload, it must match on commit.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.agents.sessions
    .bySession_id("a1b2c3d4-e5f6-7890-abcd-ef1234567890").workspace.transfers.post({
    direction: "upload",
    path: "example",
    isArchive: true,
    asArchive: true,
    sizeBytes: 4,
    sha256: "example",
});

Response Example

Show Response Example
{
  "transfer_id": "example",
  "direction": "upload",
  "status": "pending",
  "upload_id": "example",
  "part_size": 1,
  "expires_at": "2026-07-27T12:00:00Z"
}

More Information

See /v2/agents/sessions/{session_id}/workspace/transfers in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.