pydo.sessions.create()
Generated on 1 Oct 2026
from pydo version
v0.43.0
Usage
client.sessions.create(
body={
"name": "support-bot-alice",
"actorId": "alice",
"policy": {...},
...,
},
)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.
Parameters
namestring requiredExample:
support-bot-aliceRequired human-readable session name.
actorIdstring optionalExample:
aliceOptional 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'suser_id,[A-Za-z0-9._-], at most 64 characters; anything else is rejected with 400.policyobject optionalOptional tool-permission policy. Omitted asks before every call.
Show child properties
defaultActionstring optionalAction for calls no rule matches. Empty means ask; otherwise this must be allow, ask, or deny.
rulesarray of objects optionalRules for specific tools or toolbelts.
Show child properties
toolstring optionalExample:
exa_web_searchRequired. A tool slug, optionally
<tool_slug>@<version>, or a toolbelt astoolbelt:<name>@<version>. When the session selects tools, the rule must name one of them.matchobject optionalExample:
{}Optional argument conditions, keyed by argument name; the rule applies only to calls whose arguments match.
actionstring optionalRequired: allow, ask, or deny.
toolsarray of strings optionalExample:
['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 astoolbelt:<belt-name>@<version>.configobject optionalExample:
{'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.
networkobject optionalProduct-level session network binding. When set,
vpc_uuidmust identify a VPC owned by the session's team.Show child properties
vpcUuidstring optionalExample:
5a4981aa-9653-4bd1-bef5-d6bff52042e4UUID of a VPC owned by your team, in a region that supports sessions.
insightsobject optionalOmitted when the request omitted insights or explicitly sent null.
Show child properties
metricsboolean or null optionalExample:
TrueAccepted and stored for parity with the Insights schema.
logsboolean or null optionalExample:
TrueWhether the session's customer logs are sent to Insights.
tracesboolean or null optionalExample:
FalseWhether the session's customer traces are sent to Insights.
Request Sample
Response Example
More Information
See /v2/action-gateway/sessions in the API reference for additional detail on responses, headers, parameters, and more.