Droid Sessions API

Create and drive Droid sessions: manage their lifecycle, settings, and messages.

GET/api/v0/sessions

List sessions

Returns a paginated list of sessions for the authenticated user. This feature is enabled for selected organizations only.

cURL
curl 'https://api.factory.ai/api/v0/sessions' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

limitstringqueryoptional

Maximum number of items to return (1-100)

cursorstringqueryoptional

Cursor for pagination

computerIdstringqueryoptional

Computer ID to query directly

Responses

200Response for status 200
sessionsobject[]required
sessionIdstringrequired

Session ID

parent_session_idstring

Immediate parent session ID for a Task subagent, if one exists

titlestring

Session title

statusstringrequired

Current session execution status

Allowed values

idlependingrunning
messageCountintegerrequired

Number of messages in session

createdAtintegerrequired

Creation timestamp (Unix ms)

updatedAtintegerrequired

Last update timestamp (Unix ms)

completedAtinteger

Completion timestamp (Unix ms)

computerIdstring

Connected computer ID

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
toolExecutionModestring

Allowed values

direct_onlyscript_only
allowSubagentsInScriptsboolean
compactionModelstring
compactionThresholdCheckEnabledboolean
artifactsobject[]

Integration artifacts (pull requests, issues, pages) the session touched, oldest first

idstringrequired
urlstringrequired
titlestring
externalIdstring
providerstringrequired

Allowed values

githubgitlablinearjiranotionweblocalconnector
kindstringrequired

Allowed values

pull_requestissuedocumentrecordfilelink
connectorstring
fileRolestring

Allowed values

spec
actionstring

Allowed values

createupdatedeleteviewclosemerge
sourcestringrequired

Allowed values

toolclassifieruser_message
createdAtstringrequired
toolCallIdstring
factoryCreditsnumber

Total Factory credits consumed by the session and its subagents

paginationobjectrequired
hasMorebooleanrequired

Whether there are more items after this page

nextCursorstring | nullrequired

Cursor to use for the next page, null if no more pages

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

POST/api/v0/sessions

Create a session

Creates a new session with the specified configuration. This feature is enabled for selected organizations only.

cURL
curl -X POST 'https://api.factory.ai/api/v0/sessions' \
  -H 'Authorization: Bearer $FACTORY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Request body

computerIdstringrequired

Computer ID to connect

cwdstring

Working directory for the session on the computer.

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
toolExecutionModestring

Allowed values

direct_onlyscript_only
allowSubagentsInScriptsboolean
systemPromptstring | object
variantOption 1 · string

Pattern: \S

variantpreset
typestringrequired

Allowed values

preset
presetstringrequired

Allowed values

droid
appendstringrequired
compactionModelstring
compactionThresholdCheckEnabledboolean

Responses

201Response for status 201
sessionIdstringrequired

Session ID

parent_session_idstring

Immediate parent session ID for a Task subagent, if one exists

titlestring

Session title

statusstringrequired

Current session execution status

Allowed values

idlependingrunning
messageCountintegerrequired

Number of messages in session

createdAtintegerrequired

Creation timestamp (Unix ms)

updatedAtintegerrequired

Last update timestamp (Unix ms)

completedAtinteger

Completion timestamp (Unix ms)

computerIdstring

Connected computer ID

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
toolExecutionModestring

Allowed values

direct_onlyscript_only
allowSubagentsInScriptsboolean
compactionModelstring
compactionThresholdCheckEnabledboolean
artifactsobject[]

Integration artifacts (pull requests, issues, pages) the session touched, oldest first

idstringrequired
urlstringrequired
titlestring
externalIdstring
providerstringrequired

Allowed values

githubgitlablinearjiranotionweblocalconnector
kindstringrequired

Allowed values

pull_requestissuedocumentrecordfilelink
connectorstring
fileRolestring

Allowed values

spec
actionstring

Allowed values

createupdatedeleteviewclosemerge
sourcestringrequired

Allowed values

toolclassifieruser_message
createdAtstringrequired
toolCallIdstring
factoryCreditsnumber

Total Factory credits consumed by the session and its subagents

400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

504Response for status 504
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

GET/api/v0/sessions/{sessionId}

Get a session

Returns detailed session information including settings and stats. This feature is enabled for selected organizations only.

cURL
curl 'https://api.factory.ai/api/v0/sessions/{sessionId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

Session ID

computerIdstringqueryoptional

Computer ID to query directly

Responses

200Response for status 200
sessionIdstringrequired

Session ID

parent_session_idstring

Immediate parent session ID for a Task subagent, if one exists

titlestring

Session title

statusstringrequired

Current session execution status

Allowed values

idlependingrunning
messageCountintegerrequired

Number of messages in session

createdAtintegerrequired

Creation timestamp (Unix ms)

updatedAtintegerrequired

Last update timestamp (Unix ms)

completedAtinteger

Completion timestamp (Unix ms)

computerIdstring

Connected computer ID

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
toolExecutionModestring

Allowed values

direct_onlyscript_only
allowSubagentsInScriptsboolean
compactionModelstring
compactionThresholdCheckEnabledboolean
artifactsobject[]

Integration artifacts (pull requests, issues, pages) the session touched, oldest first

idstringrequired
urlstringrequired
titlestring
externalIdstring
providerstringrequired

Allowed values

githubgitlablinearjiranotionweblocalconnector
kindstringrequired

Allowed values

pull_requestissuedocumentrecordfilelink
connectorstring
fileRolestring

Allowed values

spec
actionstring

Allowed values

createupdatedeleteviewclosemerge
sourcestringrequired

Allowed values

toolclassifieruser_message
createdAtstringrequired
toolCallIdstring
factoryCreditsnumber

Total Factory credits consumed by the session and its subagents

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

DELETE/api/v0/sessions/{sessionId}

Delete a session

Deletes a session (can be restored within retention period). This feature is enabled for selected organizations only.

cURL
curl -X DELETE 'https://api.factory.ai/api/v0/sessions/{sessionId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

Session ID

computerIdstringqueryoptional

Computer ID to query directly

Responses

204Response for status 204
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

PATCH/api/v0/sessions/{sessionId}

Update a session

Updates session configuration such as model and reasoning effort. This feature is enabled for selected organizations only.

cURL
curl -X PATCH 'https://api.factory.ai/api/v0/sessions/{sessionId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Parameters

sessionIdstringpathrequired

Session ID

Request body

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
compactionModelstring
compactionThresholdCheckEnabledboolean

Responses

200Response for status 200
sessionIdstringrequired

Session ID

parent_session_idstring

Immediate parent session ID for a Task subagent, if one exists

titlestring

Session title

statusstringrequired

Current session execution status

Allowed values

idlependingrunning
messageCountintegerrequired

Number of messages in session

createdAtintegerrequired

Creation timestamp (Unix ms)

updatedAtintegerrequired

Last update timestamp (Unix ms)

completedAtinteger

Completion timestamp (Unix ms)

computerIdstring

Connected computer ID

sessionSettingsobject
modelstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
interactionModestring

Allowed values

autospecagimission
autonomyLevelstring

Allowed values

offlowmediumhigh
autonomyModestring

Deprecated: use interactionMode + autonomyLevel instead.

Allowed values

normalspecauto-lowauto-mediumauto-high
specModeModelstring
specModeReasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
providerLockstring

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
providerLockTimestampstring
apiProviderLockstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
archivedAtstring
tagsobject[]
namestringrequired
metadataobject (map)

Values

worktreeobject
branchstring
lifecyclestring

Allowed values

ephemeralpersistent
pathstring
parentWorktreePathstring
removedAtstring
repoRootstringrequired
setupProfileIdstring
enabledToolIdsstring[]
disabledToolIdsstring[]
restrictToolIdsstring[]
toolExecutionModestring

Allowed values

direct_onlyscript_only
allowSubagentsInScriptsboolean
compactionModelstring
compactionThresholdCheckEnabledboolean
artifactsobject[]

Integration artifacts (pull requests, issues, pages) the session touched, oldest first

idstringrequired
urlstringrequired
titlestring
externalIdstring
providerstringrequired

Allowed values

githubgitlablinearjiranotionweblocalconnector
kindstringrequired

Allowed values

pull_requestissuedocumentrecordfilelink
connectorstring
fileRolestring

Allowed values

spec
actionstring

Allowed values

createupdatedeleteviewclosemerge
sourcestringrequired

Allowed values

toolclassifieruser_message
createdAtstringrequired
toolCallIdstring
factoryCreditsnumber

Total Factory credits consumed by the session and its subagents

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

GET/api/v0/sessions/{sessionId}/children

List a session's child sessions

Returns the caller's sessions spawned under one parent session (Task subagents, mission agents) with their last reported status and the state of the computer each runs on, oldest first. A member of a shared workstream lists the agents under it they are a member of instead. Computer details are only included for computers the caller owns. Artifacts are included only when `includeArtifacts=true`; what each session is waiting on only when `includeAttention=true`; token usage and Factory Standard Credits, rolled up with each session's Task subagents, only when `includeUsage=true`. Archived sessions are left out unless `includeArchived=true`, which lists them with `archivedAt` and sets `archivedIncluded` on the response. For enterprise organizations, `usage.tokenCountsScope` is `byok_only` and token counts cover only calls the client reported as made with the organization's own provider keys (BYOK); managed-inference calls, and usage reported before clients tagged BYOK calls, count as zero. Credits always cover every call.

cURL
curl 'https://api.factory.ai/api/v0/sessions/{sessionId}/children' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

The parent session id

includeArtifactsstringqueryoptional

Whether to include each child session’s integration artifacts (pull requests, issues, pages).

Allowed values

truefalse
includeAttentionstringqueryoptional

Whether to include what each child session is waiting on (a permission prompt or a question).

Allowed values

truefalse
includeUsagestringqueryoptional

Whether to include each child session’s token usage and Factory Standard Credits, rolled up with its Task subagents.

Allowed values

truefalse
includeArchivedstringqueryoptional

Whether to include archived child sessions, such as a mission agent whose computer was reclaimed, each with its archivedAt. The response sets archivedIncluded when it does.

Allowed values

truefalse

Responses

200Response for status 200
sessionsobject[]required
sessionIdstringrequired

Session ID

titlestringrequired

Session title; empty until the session has one

statusstringrequired

Current session execution status

Allowed values

idlependingrunning
createdAtintegerrequired

Creation timestamp (Unix ms)

updatedAtintegerrequired

Last update timestamp (Unix ms); the status has held at least since then

tagsobject[]

Session tags, including any mission identity

namestringrequired
metadataobject (map)

Values

artifactsobject[]

Integration artifacts the session created; only returned when includeArtifacts=true

idstringrequired
urlstring <uri>required
titlestring
externalIdstring
providerstringrequired

Allowed values

githubgitlablinearjiranotionweblocalconnector
kindstringrequired

Allowed values

pull_requestissuedocumentrecordfilelink
connectorstring
fileRolestring

Allowed values

spec
actionstring

Allowed values

createupdatedeleteviewclosemerge
sourcestringrequired

Allowed values

toolclassifieruser_message
createdAtstring <date-time>required
toolCallIdstring
attentionobject | null

What the session is waiting on, or null when it is not blocked; only returned when includeAttention=true

kindstringrequired

Allowed values

permissionask-user
sinceintegerrequired
usageobject | null

Token usage and Factory Standard Credits for the session and its Task subagents, or null when it has not reported any; factoryCredits is omitted when the organization hides billable usage. For enterprise organizations tokenCountsScope is byok_only and the token counts cover only calls the client reported as BYOK; managed-inference calls, and usage reported before clients tagged BYOK calls, count as zero. Only returned when includeUsage=true

inputTokensnumberrequired
outputTokensnumberrequired
cacheCreationTokensnumberrequired
cacheReadTokensnumberrequired
factoryCreditsnumber
tokenCountsScopestring

Allowed values

byok_only
archivedAtinteger | null

When the session was archived (Unix ms), or null when it is archived but its stored marker has no readable time; absent for a live session. Only returned when includeArchived=true

computerIdstring | nullrequired

The computer the session records; null when it runs on the parent's own machine

computerobject | nullrequired

The recorded computer when the caller owns it, or null when there is none, it is gone, or it is someone else's; compare with computerId to tell these apart

idstringrequired
namestringrequired
statusstring

Allowed values

provisioningactiveerror
providerStatusstring | null

Last known sandbox lifecycle state; null for BYOM computers. More states may be added, so treat a value you do not know as unknown.

Allowed values

requestedprovisioningbootingrunningpausedsnapshottingterminatingterminatedfailed
templateIdstring | nullrequired
archivedIncludedboolean

Present when the list includes archived child sessions, as includeArchived=true asks for

Allowed values

true
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

GET/api/v0/sessions/{sessionId}/elicitations

List pending session elicitations

Returns the permission prompts (including spec approvals) and AskUser questions the session is waiting on. Each item carries the same fields the SDK permissionHandler and askUserHandler receive, plus the requestId to answer it with, and a permission prompt lists only the options the answer endpoint accepts. Items use these SDK shapes, not the MCP elicitation JSON Schema form. Option pickers (pick_options requests) are not covered. This feature is enabled for selected organizations only.

cURL
curl 'https://api.factory.ai/api/v0/sessions/{sessionId}/elicitations' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

Session ID

Responses

200Response for status 200
elicitationsobject[]required

Permission prompts and AskUser questions the session is waiting on

Each item is one of

variantpermission
toolUsesobject[]required
toolUseobjectrequired
typestringrequired

Allowed values

tool_use
idstringrequired
inputobject (map)required

Values

namestringrequired
thoughtSignaturestring
namespacestring
scriptExecutionobject
runIdstringrequired
outerToolUseIdstringrequired
seennumber
confirmationTypestringrequired

Allowed values

editexeccreateask_userexit_spec_moderecommend_missionpropose_missionstart_mission_runapply_patchmcp_toolsandbox_violationdroid_shield_violationscript
detailsobjectrequired
variantedit
typestringrequired

Allowed values

edit
filePathstringrequired
fileNamestringrequired
oldContentstring
newContentstring
variantexec
typestringrequired

Allowed values

exec
fullCommandstringrequired
commandstringrequired
extractedCommandsstring[]
impactLevelstring
riskLevelReasonstring
variantcreate
typestringrequired

Allowed values

create
filePathstringrequired
fileNamestringrequired
contentstringrequired
variantask_user
typestringrequired

Allowed values

ask_user
questionnairestringrequired
parsedobject
questionsobject[]required
indexnumberrequired
topicstringrequired
questionstringrequired
optionsstring[]required
multiSelectboolean
parseErrorobject
messagestringrequired
linenumber
variantexit_spec_mode
typestringrequired

Allowed values

exit_spec_mode
planstringrequired
titlestring
contextSavingsPercentnumber
supportsClientStartedHandoffboolean
variantpropose_mission
typestringrequired

Allowed values

propose_mission
proposalstringrequired
titlestring
variantstart_mission_run
typestringrequired

Allowed values

start_mission_run
runningMissionCountnumberrequired
runningMissionSessionIdsstring[]required
variantapply_patch
typestringrequired

Allowed values

apply_patch
filePathstringrequired
fileNamestringrequired
patchContentstringrequired
oldContentstring
newContentstring
filesobject[]
filePathstringrequired
fileNamestringrequired
operationstringrequired

Allowed values

createupdatedelete
moveTostring
oldContentstring
newContentstring
variantmcp_tool
typestringrequired

Allowed values

mcp_tool
toolNamestringrequired
impactLevelstringrequired
serverNamestring
actualToolNamestring
variantsandbox_violation
typestringrequired

Allowed values

sandbox_violation
violatingToolNamestringrequired
targetstringrequired
operationTypestringrequired

Allowed values

readwritenetworktool
violationTypestringrequired

Allowed values

filesystem-readfilesystem-writenetworktool
reasonstringrequired
violationReasonstring

Allowed values

deny-listnot-allowed
isOrgDenybooleanrequired
variantdroid_shield_violation
typestringrequired

Allowed values

droid_shield_violation
commandstringrequired
reasonstringrequired
variantrecommend_mission
typestringrequired

Allowed values

recommend_mission
reasonstringrequired
variantscript
typestringrequired

Allowed values

script
impactLevelstringrequired
callsobject[]required
toolNamestringrequired
linenumberrequired
columnnumberrequired
toolInputobject (map)required

Values

confirmationobjectrequired
variantedit
typestringrequired

Allowed values

edit
filePathstringrequired
fileNamestringrequired
oldContentstring
newContentstring
variantexec
typestringrequired

Allowed values

exec
fullCommandstringrequired
commandstringrequired
extractedCommandsstring[]
impactLevelstring
riskLevelReasonstring
variantcreate
typestringrequired

Allowed values

create
filePathstringrequired
fileNamestringrequired
contentstringrequired
variantask_user
typestringrequired

Allowed values

ask_user
questionnairestringrequired
parsedobject
questionsobject[]required
indexnumberrequired
topicstringrequired
questionstringrequired
optionsstring[]required
multiSelectboolean
parseErrorobject
messagestringrequired
linenumber
variantexit_spec_mode
typestringrequired

Allowed values

exit_spec_mode
planstringrequired
titlestring
contextSavingsPercentnumber
supportsClientStartedHandoffboolean
variantpropose_mission
typestringrequired

Allowed values

propose_mission
proposalstringrequired
titlestring
variantstart_mission_run
typestringrequired

Allowed values

start_mission_run
runningMissionCountnumberrequired
runningMissionSessionIdsstring[]required
variantapply_patch
typestringrequired

Allowed values

apply_patch
filePathstringrequired
fileNamestringrequired
patchContentstringrequired
oldContentstring
newContentstring
filesobject[]
filePathstringrequired
fileNamestringrequired
operationstringrequired

Allowed values

createupdatedelete
moveTostring
oldContentstring
newContentstring
variantmcp_tool
typestringrequired

Allowed values

mcp_tool
toolNamestringrequired
impactLevelstringrequired
serverNamestring
actualToolNamestring
variantsandbox_violation
typestringrequired

Allowed values

sandbox_violation
violatingToolNamestringrequired
targetstringrequired
operationTypestringrequired

Allowed values

readwritenetworktool
violationTypestringrequired

Allowed values

filesystem-readfilesystem-writenetworktool
reasonstringrequired
violationReasonstring

Allowed values

deny-listnot-allowed
isOrgDenybooleanrequired
variantdroid_shield_violation
typestringrequired

Allowed values

droid_shield_violation
commandstringrequired
reasonstringrequired
variantrecommend_mission
typestringrequired

Allowed values

recommend_mission
reasonstringrequired
alwaysAskboolean
optionsobject[]required
labelstringrequired
valuestringrequired

Allowed values

proceed_onceproceed_alwaysproceed_always_fileproceed_auto_runproceed_auto_run_lowproceed_auto_run_mediumproceed_auto_run_highproceed_new_sessionproceed_new_session_lowproceed_new_session_mediumproceed_new_session_highproceed_editproceed_always_toolsproceed_always_serverproceed_report_false_positivecancel
associatedSessionIdsstring[]
typestringrequired

Allowed values

permission
requestIdstringrequired

ID to answer the prompt with

variantask-user
toolCallIdstringrequired
questionsobject[]required
indexnumberrequired
topicstringrequired
questionstringrequired
optionsstring[]required
optionDescriptionsstring[]
multiSelectboolean
blockingboolean
contextstring
typestringrequired

Allowed values

ask-user
requestIdstringrequired

ID to answer the questions with

400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

504Response for status 504
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

POST/api/v0/sessions/{sessionId}/elicitations/{requestId}

Answer a pending session elicitation

Answers one pending elicitation with the same result the SDK handlers return: `selectedOption` (one of the prompt's listed `options[].value`) for a permission prompt, or `answers` (exactly one per question, matched by index) or `cancelled: true` for AskUser questions. Persistent "always" options, `proceed_edit`, and `proceed_new_session*` are not listed or accepted. `comment` reaches the agent only when approving a spec; a `cancel` drops it, so send feedback with `POST /api/v0/sessions/{sessionId}/messages` after rejecting. 200 means the session applied this answer; for a permission prompt the response names the option it applied. Returns 409 when the elicitation is not pending: it was never a pending prompt of this session, another client answered it first, or its turn ended. Returns 503 when the session's computer runs a Droid version that cannot answer elicitations through this API. This feature is enabled for selected organizations only.

cURL
curl -X POST 'https://api.factory.ai/api/v0/sessions/{sessionId}/elicitations/{requestId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Parameters

sessionIdstringpathrequired

Session ID

requestIdstringpathrequired

Pending elicitation ID

Request body

variantOption 1 · object
cancelledbooleanrequired

Dismiss an AskUser elicitation without answering

Allowed values

true
answersobject[]
indexnumberrequired
questionstringrequired
answerstringrequired
selectedOptionnot allowed
variantOption 2 · object
answersobject[]required

Answers to an AskUser elicitation: exactly one per question, matched by index

indexnumberrequired
questionstringrequired
answerstringrequired
cancelledboolean

Allowed values

false
selectedOptionnot allowed
variantOption 3 · object
selectedOptionstringrequired

One of the permission elicitation's options[].value

Allowed values

proceed_onceproceed_alwaysproceed_always_fileproceed_auto_runproceed_auto_run_lowproceed_auto_run_mediumproceed_auto_run_highproceed_new_sessionproceed_new_session_lowproceed_new_session_mediumproceed_new_session_highproceed_editproceed_always_toolsproceed_always_serverproceed_report_false_positivecancel
commentstring

Note passed to the agent when approving a spec. Rejections and other prompts drop it; after cancel, send feedback as a message

answersnot allowed
cancellednot allowed

Responses

200Response for status 200
requestIdstringrequired

The answered elicitation ID

selectedOptionstring

For a permission prompt, the option the session settled it with: the one this answer sent

Allowed values

proceed_onceproceed_alwaysproceed_always_fileproceed_auto_runproceed_auto_run_lowproceed_auto_run_mediumproceed_auto_run_highproceed_new_sessionproceed_new_session_lowproceed_new_session_mediumproceed_new_session_highproceed_editproceed_always_toolsproceed_always_serverproceed_report_false_positivecancel
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

409Response for status 409
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

504Response for status 504
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

POST/api/v0/sessions/{sessionId}/interrupt

Interrupt a session

Interrupts a running agent loop. Idempotent if already idle. This feature is enabled for selected organizations only.

cURL
curl -X POST 'https://api.factory.ai/api/v0/sessions/{sessionId}/interrupt' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

Responses

200Response for status 200
statusstringrequired

Current session execution status

Allowed values

idlependingrunning
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

GET/api/v0/sessions/{sessionId}/messages

Get session messages

Returns paginated message history with optional role filtering. This feature is enabled for selected organizations only.

cURL
curl 'https://api.factory.ai/api/v0/sessions/{sessionId}/messages' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired
limitstringqueryoptional

Maximum number of items to return (1-100)

cursorstringqueryoptional

Cursor for pagination

computerIdstringqueryoptional

Computer ID to query directly

rolestringqueryoptional

Filter messages by role

Allowed values

userassistanttool

Responses

200Response for status 200
messagesobject[]required
idstringrequired
rolestringrequired

Allowed values

userassistanttoolsystem
contentobject[]required

Each item is one of

varianttext
idstring
typestringrequired

Allowed values

text
textstringrequired
variantimage
idstring
typestringrequired

Allowed values

image
sourceobjectrequired
typestringrequired

Allowed values

base64
datastringrequired
mediaTypestringrequired

Allowed values

image/jpegimage/pngimage/gifimage/webp
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
generatedboolean
variantthinking
idstring
typestringrequired

Allowed values

thinking
signaturestringrequired
signatureProviderstring
variantOption 1

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
variantOption 2

Allowed values

unknown
thinkingstringrequired
durationMsnumber
progressUpdateboolean
variantredacted_thinking
idstring
typestringrequired

Allowed values

redacted_thinking
datastringrequired
varianttool_use
typestringrequired

Allowed values

tool_use
idstringrequired
inputobject (map)required

Values

namestringrequired
thoughtSignaturestring
namespacestring
scriptExecutionobject
runIdstringrequired
outerToolUseIdstringrequired
seennumber
varianttool_result
idstring
typestringrequired

Allowed values

tool_result
toolUseIdstringrequired
contentstring | object[]
variantOption 1 · string
variantOption 2 · object[]

Each item is one of

varianttext
idstring
typestringrequired

Allowed values

text
textstringrequired
variantimage
idstring
typestringrequired

Allowed values

image
sourceobjectrequired
typestringrequired

Allowed values

base64
datastringrequired
mediaTypestringrequired

Allowed values

image/jpegimage/pngimage/gifimage/webp
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
generatedboolean
variantdocument
idstring
typestringrequired

Allowed values

document
sourceobjectrequired
variantbase64
typestringrequired

Allowed values

base64
mediaTypestringrequired

Allowed values

application/pdf
datastringrequired
parsedDatastring
namestring
pathstring
varianttext
typestringrequired

Allowed values

text
mediaTypestringrequired

Allowed values

text/plain
datastringrequired
namestring
mimestring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
isErrorboolean
modelContentstring
respondedByobject
userIdstringrequired
namestring
sourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
variantdocument
idstring
typestringrequired

Allowed values

document
sourceobjectrequired
variantbase64
typestringrequired

Allowed values

base64
mediaTypestringrequired

Allowed values

application/pdf
datastringrequired
parsedDatastring
namestring
pathstring
varianttext
typestringrequired

Allowed values

text
mediaTypestringrequired

Allowed values

text/plain
datastringrequired
namestring
mimestring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
createdAtnumberrequired
updatedAtnumberrequired
parentIdstring
seqinteger
userMessageSourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
senderobject
variantorchestrator
kindstringrequired

Allowed values

orchestrator
sessionIdstringrequired
variantagent
kindstringrequired

Allowed values

agent
titlestringrequired
sessionIdstringrequired
authorobject
userIdstringrequired
namestring
sourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
interactionModestring

Allowed values

autospecagimission
visibilitystring

Allowed values

bothllm_onlyuser_only
openaiMessageIdstring
openaiPhasestring | null

Allowed values

commentaryfinal_answer
openaiEncryptedContentstring
openaiReasoningIdstring
openaiReasoningSummarystring
geminiThoughtSignaturestring

@deprecated Use thinking block `signature` fields with `signatureProvider: "google"` instead. Do not use in new code.

chatCompletionReasoningFieldstring

Allowed values

reasoningreasoning_content
chatCompletionReasoningContentstring
geminiNativeContentstring
isUserVisibleboolean
isErrorboolean
modelIdstring
apiProviderstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
routerIdstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
hookEventNamestring
hookMatcherstring
hookCommandsobject[]
commandstringrequired
timeoutnumber
hookStatusstring

Allowed values

executingcompletederror
hookResultsobject[]
exitCodenumberrequired
stdoutstringrequired
stderrstringrequired
suppressOutputboolean
hookToolCallIdstring
hookParentIdstring
hookOrdernumber
hookPreventedActionboolean
hiddenFromUserViewsboolean
hookStartTimenumber
hookEndTimenumber
isParallelExecutionboolean
parallelGroupIdstring
paginationobjectrequired
hasMorebooleanrequired

Whether there are more items after this page

nextCursorstring | nullrequired

Cursor to use for the next page, null if no more pages

400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

504Response for status 504
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

POST/api/v0/sessions/{sessionId}/messages

Add a message to a session

Adds a user message and optionally waits for agent completion. Supports text, images, and file attachments. This feature is enabled for selected organizations only.

cURL
curl -X POST 'https://api.factory.ai/api/v0/sessions/{sessionId}/messages' \
  -H 'Authorization: Bearer $FACTORY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ ... }'

Parameters

sessionIdstringpathrequired

Request body

textstringrequired

Message text content

imagesobject[]

Optional base64-encoded images

typestringrequired

Allowed values

base64
datastringrequired
mediaTypestringrequired

Allowed values

image/jpegimage/pngimage/gifimage/webp
filesobject[]

Optional file attachments (PDFs, text files)

Each item is one of

variantbase64
typestringrequired

Allowed values

base64
mediaTypestringrequired

Allowed values

application/pdf
datastringrequired
parsedDatastring
namestring
pathstring
varianttext
typestringrequired

Allowed values

text
mediaTypestringrequired

Allowed values

text/plain
datastringrequired
namestring
mimestring
computerIdstring

Computer ID to route the message to; falls back to the session.computerId if omitted

senderobject

The mission session sending this message (the orchestrator, or an agent by name), stored on the message so clients can attribute it and the model sees a [From …] header. Omit for human messages.

variantorchestrator
kindstringrequired

Allowed values

orchestrator
sessionIdstringrequired
variantagent
kindstringrequired

Allowed values

agent
titlestringrequired
sessionIdstringrequired

Responses

200Response for status 200
messageIdstringrequired

ID of the created user message

statusstringrequired

Agent status after message submission

Allowed values

idlependingrunning
recipientDroidStatusstring

The recipient's agent status before this message was submitted: idle means the message starts a turn now, running means it is queued behind the current turn. Omitted when the session was addressed by computerId.

Allowed values

idlependingrunning
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

504Response for status 504
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

GET/api/v0/sessions/{sessionId}/messages/{messageId}

Get a message by ID

Returns a single message from the session by its ID. This feature is enabled for selected organizations only.

cURL
curl 'https://api.factory.ai/api/v0/sessions/{sessionId}/messages/{messageId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'

Parameters

sessionIdstringpathrequired

Session ID

messageIdstringpathrequired

Message ID

computerIdstringqueryoptional

Computer ID to query directly

Responses

200Response for status 200
idstringrequired
rolestringrequired

Allowed values

userassistanttoolsystem
contentobject[]required

Each item is one of

varianttext
idstring
typestringrequired

Allowed values

text
textstringrequired
variantimage
idstring
typestringrequired

Allowed values

image
sourceobjectrequired
typestringrequired

Allowed values

base64
datastringrequired
mediaTypestringrequired

Allowed values

image/jpegimage/pngimage/gifimage/webp
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
generatedboolean
variantthinking
idstring
typestringrequired

Allowed values

thinking
signaturestringrequired
signatureProviderstring
variantOption 1

Allowed values

anthropicopenaigeneric-chat-completion-apifactorygooglexaibedrock-converse
variantOption 2

Allowed values

unknown
thinkingstringrequired
durationMsnumber
progressUpdateboolean
variantredacted_thinking
idstring
typestringrequired

Allowed values

redacted_thinking
datastringrequired
varianttool_use
typestringrequired

Allowed values

tool_use
idstringrequired
inputobject (map)required

Values

namestringrequired
thoughtSignaturestring
namespacestring
scriptExecutionobject
runIdstringrequired
outerToolUseIdstringrequired
seennumber
varianttool_result
idstring
typestringrequired

Allowed values

tool_result
toolUseIdstringrequired
contentstring | object[]
variantOption 1 · string
variantOption 2 · object[]

Each item is one of

varianttext
idstring
typestringrequired

Allowed values

text
textstringrequired
variantimage
idstring
typestringrequired

Allowed values

image
sourceobjectrequired
typestringrequired

Allowed values

base64
datastringrequired
mediaTypestringrequired

Allowed values

image/jpegimage/pngimage/gifimage/webp
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
generatedboolean
variantdocument
idstring
typestringrequired

Allowed values

document
sourceobjectrequired
variantbase64
typestringrequired

Allowed values

base64
mediaTypestringrequired

Allowed values

application/pdf
datastringrequired
parsedDatastring
namestring
pathstring
varianttext
typestringrequired

Allowed values

text
mediaTypestringrequired

Allowed values

text/plain
datastringrequired
namestring
mimestring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
isErrorboolean
modelContentstring
respondedByobject
userIdstringrequired
namestring
sourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
variantdocument
idstring
typestringrequired

Allowed values

document
sourceobjectrequired
variantbase64
typestringrequired

Allowed values

base64
mediaTypestringrequired

Allowed values

application/pdf
datastringrequired
parsedDatastring
namestring
pathstring
varianttext
typestringrequired

Allowed values

text
mediaTypestringrequired

Allowed values

text/plain
datastringrequired
namestring
mimestring
elidedobject
bytesintegerrequired
linesinteger
widthinteger
heightinteger
previewstring
createdAtnumberrequired
updatedAtnumberrequired
parentIdstring
seqinteger
userMessageSourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
senderobject
variantorchestrator
kindstringrequired

Allowed values

orchestrator
sessionIdstringrequired
variantagent
kindstringrequired

Allowed values

agent
titlestringrequired
sessionIdstringrequired
authorobject
userIdstringrequired
namestring
sourcestring

Allowed values

webdesktopcli_tuicli_execcli_acpslackjiralinearmicrosoft-teamsgoogle-chatsessions_apiapisdkautomationreadiness-remediationreadiness-evaluationwiki-generationwiki-ci-setup
interactionModestring

Allowed values

autospecagimission
visibilitystring

Allowed values

bothllm_onlyuser_only
openaiMessageIdstring
openaiPhasestring | null

Allowed values

commentaryfinal_answer
openaiEncryptedContentstring
openaiReasoningIdstring
openaiReasoningSummarystring
geminiThoughtSignaturestring

@deprecated Use thinking block `signature` fields with `signatureProvider: "google"` instead. Do not use in new code.

chatCompletionReasoningFieldstring

Allowed values

reasoningreasoning_content
chatCompletionReasoningContentstring
geminiNativeContentstring
isUserVisibleboolean
isErrorboolean
modelIdstring
apiProviderstring

Allowed values

bedrockanthropicvertex_anthropicbedrock_anthropicbedrock_conversebedrock_openaiopenaiazure_openaiazure_anthropicgooglexaimistralfireworksbasetentogethersnowflakedatabricks
routerIdstring
reasoningEffortstring

Allowed values

nonedynamicoffminimallowmediumhighxhighmax
hookEventNamestring
hookMatcherstring
hookCommandsobject[]
commandstringrequired
timeoutnumber
hookStatusstring

Allowed values

executingcompletederror
hookResultsobject[]
exitCodenumberrequired
stdoutstringrequired
stderrstringrequired
suppressOutputboolean
hookToolCallIdstring
hookParentIdstring
hookOrdernumber
hookPreventedActionboolean
hiddenFromUserViewsboolean
hookStartTimenumber
hookEndTimenumber
isParallelExecutionboolean
parallelGroupIdstring
400Response for status 400
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

401Response for status 401
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

402Response for status 402
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

403Response for status 403
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

404Response for status 404
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

429Response for status 429
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

500Response for status 500
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values

503Response for status 503
detailstringrequired

Human-readable error message

statusnumberrequired

HTTP status code

titlestringrequired

HTTP status title

metadataobject (map)

Additional error metadata

Values