For AI agents: The documentation index is at 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).
Usage
client.v2.agents.sessions.bySession_id(session_id).fork.post(body: Fork_session_request, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Fork_session_response>
Description
Each child boots a fresh sandbox from the checkpoint’s machine-state capture and is drivable exactly like any other session (input, HITL), with parent_session_id and fork_id set for lineage. When from_checkpoint_id is omitted, an implicit checkpoint of the session “now” is captured first and the children fork from that. All-or-nothing: on failure nothing is left running.
Parameters
Path Parameters
session_id string required
Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
The session UUID.
Request Body
fromCheckpointId string optional
Checkpoint to fork from; must be READY. Omitted/empty means capture an implicit checkpoint of the session "now" first and fork from that.
count integer optional
Number of child sessions to create, 1-4. Defaults to 1 when omitted; a value outside 1-4 is rejected with 400.
Default: 1
Min: 1
Max: 4
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").fork.post({
fromCheckpointId: "string",
count: 1,
});
Response Example
Show Response Example
{
"sessions": [
{
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "demo-agent",
"parent_session_id": "example",
"fork_id": "11111111-2222-3333-4444-555555555555",
"fork_from_checkpoint_id": "example",
"agent_kind": "AGENT_KIND_UNSPECIFIED",
"status": "SESSION_STATUS_UNSPECIFIED",
"sandbox_id": "example",
"created_at": "2026-08-01T12:00:00Z",
"last_event_at": "2026-08-01T12:00:00Z",
"keep_warm": false,
"resume_on_topoff": false,
"pause_reason": "example",
"idle_timeout_seconds": 60,
"repo_hint": "example",
"warnings": [],
"config_id": "11111111-2222-3333-4444-555555555555",
"openai_session_id": "example",
"openai_environment_id": "example",
"region": "ric1",
"workspace_id": "019a2f4e-8c1d-7b3a-9e5f-2d6c8a1b4e70"
}
]
}
See /v2/agents/sessions/{session_id}/fork in the API reference for additional detail on responses, headers, parameters, and more.