dots.v2.actionGateway.sessions.post()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.actionGateway.sessions.post(body: Session_create, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Create_session_response>

Description

Creates a session owned by your team, with a new session URN, and returns the MCP URL an agent connects to. tools selects the tools and toolbelts the session exposes, and policy decides which calls run, need approval, or are refused.

Set config.cache to opt into result caching for all eligible tools or a specific list. Caching is off by default and must be enabled for the team.

Parameters

name string required

Example: support-bot-alice

Required human-readable session name.

actorId string optional

Example: alice

Optional actor binding: the user whose connections the session's tool calls use, matched against connection user_id. When set it must use the same alphabet as a connection's user_id, [A-Za-z0-9._-], at most 64 characters; anything else is rejected with 400.

policy object or null optional

Optional tool-permission policy. Omitted asks before every call.

Show child properties
defaultAction string optional

Action for calls no rule matches. Empty means ask; otherwise this must be allow, ask, or deny.

One of: allow, ask, deny

rules array of objects optional

Rules for specific tools or toolbelts.

Additional nested properties are not shown.

tools array of strings optional

Example: ["toolbelt:search-toolbelt@1", "jira_create_issue"]

Omitted enables every tool. An explicit empty array enables no tools. Direct tools may be <tool> or <tool>@<version>, using provider-qualified tool slugs, and a pinned version must be the released one; toolbelt references must be version-pinned as toolbelt:<belt-name>@<version>.

config object optional

Example: {"preloadTools": ["exa_web_search"], "outputViews": {"exa_web_search": "titles-and-urls"}, "customInstructions": "Prefer primary sources and cite URLs."}

Optional session options. config.preloadTools may contain concrete tool names (optionally version-pinned) and version-pinned toolbelt references. config.customInstructions is a string of at most 1000 characters. config.outputViews maps up to 100 tool slugs to the name of an output view to apply to that tool's results. config.cache opts eligible tools into result caching for this session.

Show child properties
cache object optional

Example: {"allEligible": true, "maxAgeSeconds": 60}

Opts the session into result caching. Omit config.cache to leave caching off. Set exactly one of tools or allEligible. Caching must also be enabled for the team. Tool selection and permission rules still apply to every call.

Show child properties
tools array of strings optional

Example: ["exa_web_search"]

Provider-qualified tool slugs to cache. Every listed tool must resolve for the team and have a catalog cache policy, or session creation fails. Use slugs without version suffixes or toolbelt references. An empty array enables no tools.

allEligible boolean optional

Example: true

Enables caching for every called tool version with a catalog cache policy, including tools that become eligible after session creation. Do not combine with tools.

maxAgeSeconds integer optional

Example: 60

Maximum cache lifetime in seconds for this session. Omit to use each tool's lifetime, up to 300 seconds. A smaller tool lifetime or provider response cache header can shorten it. Per-call max_age_seconds can require a fresher result but cannot increase this limit.

Min: 1

Max: 300

network object optional

Product-level session network binding. When set, vpc_uuid must identify a VPC owned by the session's team.

Show child properties
vpcUuid string optional

Example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4

UUID of a VPC owned by your team, in a region that supports sessions.

insights object optional

Omitted when the request omitted insights or explicitly sent null.

Show child properties
metrics boolean or null optional

Example: true

Accepted and stored for parity with the Insights schema.

logs boolean or null optional

Example: true

Whether the session's customer logs are sent to Insights.

traces boolean or null optional

Example: false

Whether the session's customer traces are sent to Insights.

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.actionGateway.sessions.post({
    name: "support-bot-alice",
    actorId: "alice",
    tools: [
        "toolbelt:search-toolbelt@1",
        "jira_create_issue",
    ],
    policy: {
        defaultAction: "ask",
        rules: [
            {
                tool: "toolbelt:search-toolbelt@1",
                match: {},
                action: "allow",
            },
            {
                tool: "jira_create_issue",
                match: {},
                action: "ask",
            },
        ],
    },
    config: {},
});

Response Example

Show Response Example
{
  "session": {
    "sessionUrn": "do:managed_agent_session:2b3c9f0e-1a4d-4e5f-8a7b-6c5d4e3f2a1b",
    "policy": {
      "defaultAction": "ask",
      "rules": [
        {
          "tool": "toolbelt:search-toolbelt@1",
          "match": {},
          "action": "allow"
        },
        {
          "tool": "jira_create_issue",
          "match": {},
          "action": "ask"
        }
      ]
    },
    "createdAt": "2026-09-24T12:00:00Z",
    "updatedAt": "2026-09-24T12:00:00Z",
    "name": "support-bot-alice",
    "actorId": "alice",
    "tools": {
      "references": [
        {
          "kind": "SESSION_TOOL_REFERENCE_KIND_TOOLBELT",
          "name": "search-toolbelt",
          "version": "1"
        },
        {
          "kind": "SESSION_TOOL_REFERENCE_KIND_TOOL",
          "name": "jira_create_issue",
          "version": "1"
        }
      ]
    },
    "config": {
      "preloadTools": [
        "exa_web_search"
      ],
      "outputViews": {
        "exa_web_search": "titles-and-urls"
      }
    },
    "agentUrn": "",
    "agentName": "",
    "owning_user_id": "2f8e1c3a-6b4d-4f7e-9a1c-5d3b7e9f1a2c"
  },
  "mcpUrl": "https://actions.do-ai.run/mcp/session/2b3c9f0e-1a4d-4e5f-8a7b-6c5d4e3f2a1b",
  "tools": [
    "toolbelt:search-toolbelt@1",
    "jira_create_issue@1"
  ]
}

More Information

See /v2/action-gateway/sessions 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.