Skip to main content
POST
/
api
/
v1
/
local
/
session
Create session
curl --request POST \
  --url https://api.coralcloud.ai/api/v1/local/session \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agentGraphRequest": {
    "agents": [
      {
        "id": {
          "name": "<string>",
          "version": "<string>",
          "registrySourceId": {
            "type": "linked",
            "linkedServerId": "<string>"
          }
        },
        "name": "<string>",
        "provider": {
          "type": "linked",
          "linkedServerName": "<string>",
          "runtime": "executable"
        },
        "description": "<string>",
        "options": {},
        "systemPrompt": "<string>",
        "blocking": true,
        "customToolAccess": [
          "<string>"
        ],
        "plugins": [
          {
            "type": "close_session_tool"
          }
        ],
        "x402Budgets": [
          {
            "priority": 123,
            "resource": "<string>",
            "remainingBudget": 123
          }
        ],
        "annotations": {}
      }
    ],
    "groups": [
      [
        "<string>"
      ]
    ],
    "customTools": {}
  },
  "namespaceProvider": {
    "type": "create_if_not_exists",
    "namespaceRequest": {
      "name": "<string>",
      "deleteOnLastSessionExit": true,
      "annotations": {}
    }
  },
  "execution": {
    "mode": "defer"
  },
  "annotations": {}
}
'
{
  "namespace": "<string>",
  "sessionId": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

The session request body, containing the agents to use in the session and other settings

agentGraphRequest
AgentGraphRequest · object
required

A request for the agents in this session

namespaceProvider
create_if_not_exists · object
required
    Provides a full namespace request to create an ad hoc namespace if the namespace doesn't already exist.  Note
    that this will not update an existing namespace, so for example, there is no guarantee that annotations 
    specified on this request end up on the namespace that this session belongs in.
    
execution
defer · object

The session's execution is deferred. A deferred execution must be executed manually later

annotations
LinkedHashMap<String,String> · object

Response

Success

namespace
string
required

The namespace that this session belongs in

sessionId
string
required

The unique identifier for the session