Sessions
Endpoints for managing the lifecycle of a conversation. All three require authentication — see Authentication.
List sessions
Returns every session the authenticated user has created, newest first.
/v1/sessionsResponse
sessionsSession[]Array of sessions owned by the caller.
sessions[].sessionIdstringThe session identifier.
sessions[].createdAtnumberUnix timestamp (ms) of when the session was created.
Example
curl "$BASE_URL/v1/sessions" \
-H "Authorization: Bearer $TOKEN"Create a session
Creates a new conversation session for the authenticated user. The
recommended shape is to send a customizations body picking an agent
and (optionally) its extensions. If you send no body, the backend
falls back to the default agent at message time — see
Concepts: Sessions — Default agent.
/v1/sessionsRequest body
All configuration lives under a top-level customizations field. It
accepts one of three variants:
- Simple — pick a registered agent bundle by
agentIdand optionally attachextensions. This is the most common shape. - Full — bypass the bundle and specify a
modeldirectly along withextensions(advanced; lets you compose system prompts and tools manually). - Minimal — no
agentId, justextensionsand/orsessionData; the session resolves to the default agent at message time.
customizationsobjectConfigures the session. All fields below live under this key.
customizations.productstringIdentifies which product is consuming the session. Used for prompt
resolution, quota tracking, and analytics. Examples: "warehouse-agent",
"smart-help".
customizations.agentIdstringWhich model bundle to use for this session. Determines the system prompt, tool providers, and inference parameters. See Models for available bundles. Required for the Simple variant.
customizations.modelstringFoundation-model identifier for the Full variant. Mutually exclusive
with agentId.
customizations.extensionsobjectOptional per-session capabilities. All fields below are optional.
customizations.extensions.toolsRecord<string, ToolDefinition>Client-supplied tool definitions, keyed by tool name. Each tool has a
name, description, requestArgs (JSON Schema for input), and
responseShape (JSON Schema for output). See
Tool Definitions.
customizations.extensions.ragobjectRetrieval-augmented generation configuration. When set, the model can query document indexes as part of its response.
customizations.extensions.rag.indexesstring[]Which vector indexes to search. Example: ["platform-docs"].
customizations.extensions.rag.prefetchEnabledbooleanWhether to prefetch documents on session start.
customizations.extensions.rag.maxResultsnumberMaximum number of documents to retrieve per query.
customizations.extensions.rag.tagFilterobjectFilter documents by metadata tags. Has include and exclude fields,
each mapping tag names to arrays of accepted values.
customizations.extensions.mcpProvidersstring[]List of MCP provider names to enable for this session. The platform
will load tool definitions from these providers via its MCP gateway.
Today the only registered provider is "netsuite".
Response
sessionIdstringThe new session's identifier. Save it — you'll need it for every subsequent message and tool call.
Examples
Simple (recommended starting point) — pick an agent:
curl -X POST "$BASE_URL/v1/sessions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customizations": {
"agentId": "RfsAgent",
"extensions": {}
}
}'With extensions — tools, RAG, and MCP providers:
curl -X POST "$BASE_URL/v1/sessions" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customizations": {
"product": "warehouse-agent",
"agentId": "RfsAgent",
"extensions": {
"tools": {
"getLocations": {
"name": "getLocations",
"description": "Retrieves warehouse locations",
"requestArgs": {
"properties": {
"includeInactive": { "type": "boolean" }
}
},
"responseShape": {
"properties": {
"locations": { "type": "array" }
}
}
}
},
"rag": {
"indexes": ["platform-docs"],
"maxResults": 10,
"tagFilter": {
"include": { "productCode": ["ns"] }
}
},
"mcpProviders": ["netsuite"]
}
}
}'Delete a session
Hard-deletes a session and cascades to its messages and tool calls. There is no recovery.
/v1/sessions/:sessionIdPath parameters
sessionIdstringrequiredThe session to delete. Must belong to the authenticated user.
Response
204 No Content on success. 404 if the session doesn't exist or is
owned by another user.
Deletion is not reversible. If you need an audit trail, export messages
first via GET /v1/messages/:sessionId.
Example
curl -X DELETE "$BASE_URL/v1/sessions/$SESSION_ID" \
-H "Authorization: Bearer $TOKEN"