Skip to main content
POST
Create a new agent session

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required
Minimum string length: 1
workspaceElementType
enum<string>
Available options:
tenant,
app,
connector,
integration,
action,
connection,
data-table,
data-table-record,
data-sync,
data-sync-run,
external-event-subscription,
external-event-log-record,
external-event-pull,
external-event-type,
action-run-log-record,
external-api-log-record,
incoming-webhook-log-record,
connected-product,
external-agent,
job,
deliverable,
deliverable-type,
routine,
task,
canvas,
file,
knowledge-article,
knowledge-sync,
knowledge-sync-pull
workspaceElementId
string
Minimum string length: 1
testTenantId
string
isExternal
boolean
modelId
enum<string>
Available options:
anthropic/claude-sonnet-5,
anthropic/claude-sonnet-4.6,
anthropic/claude-opus-4.6,
anthropic/claude-sonnet-4.5,
anthropic/claude-opus-4.5,
anthropic/claude-haiku-4.5,
openai/gpt-5.2,
openai/gpt-5-nano,
openai/gpt-4o-mini,
google/gemini-3-pro-preview,
moonshotai/kimi-k2.5,
z-ai/glm-5.2,
deepseek/deepseek-v4-pro
preset
enum<string>

Which situation the agent runs in. Defaults from the bound element type, else general.

Available options:
general,
canvas,
context,
connection-build,
action-build,
task,
work,
universe
surface
enum<string>

The UI surface this session is launched in — selects the affordance instruction the agent gets (whether it can render one-click buttons, whether a live user is watching, whether it is already inside the connect flow). Defaults to background for child / inline-build sessions, else unset.

Available options:
console-chat,
context-rail,
table-chat,
connect-popup,
mcp-embedded,
cli,
desktop,
background,
default-external-agent
launchContext
object

Where the session is launched from (surface / app route / anchored element). Merged with the top-level surface and workspaceElementType/Id fields (which win when both are set) and rendered into the agent's "Where you are" context.

agentHarnessId
string
Minimum string length: 1
promptAttachments
object[]
parentSessionId
string
Minimum string length: 1
synthetic
boolean

When true, the initial prompt is a hidden system kickoff: the model receives it, but the chat UI suppresses the user bubble. Mirrors the resume-path synthetic flag.

Response

200 - application/json
id
string
required
workspaceId
string
required
type
string
required
status
enum<string>
required
Available options:
queued,
starting,
running,
completed,
failed,
cancelled
prompt
string
required
lastActivityAt
string<date-time>
required

Last meaningful session progress timestamp used for inactivity timeout checks.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
hasWorker
boolean
required
createdAt
string<date-time>
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
updatedAt
string<date-time>
required
Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
userId
string
tenantId
string
ownerName
string | null
orgWorkspaceId
string
workspaceElementType
enum<string>
Available options:
tenant,
app,
connector,
integration,
action,
connection,
data-table,
data-table-record,
data-sync,
data-sync-run,
external-event-subscription,
external-event-log-record,
external-event-pull,
external-event-type,
action-run-log-record,
external-api-log-record,
incoming-webhook-log-record,
connected-product,
external-agent,
job,
routine,
task,
canvas,
knowledge-article,
knowledge-sync,
knowledge-sync-pull
workspaceElementId
string
error
object
archivedAt
string<date-time>

When set, the session is archived (soft-deleted) and hidden from lists.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
title
string
summary
string
cost
number
state
enum<string>
default:busy
Available options:
busy,
idle
isExternal
boolean
preset
enum<string>

Which situation the one membrane agent runs in — selects the skills + context it loads.

Available options:
general,
canvas,
context,
connection-build,
action-build,
task,
work,
universe
launchContext
object

Where the session was launched from — the resolved surface / route / element envelope shared by the console UI and the agent.

agentHarnessId
string
agentHarnessSnapshotId
string
output
object
outputAttachments
object[]
parentSessionId
string