Skip to content

Start an agent session

POST/api/v1/sessions

The prompt is its first turn. When every slot is taken it waits in line, and queuedAt is its place. Needs agents.manage.

Needs an API key in the Authorization header.

On this page

Request body

FieldTypeDescription
promptrequiredstring
  • min length: 1
  • max length: 20000
repostring
  • default:
  • max length: 140
titlestring
  • default:
  • max length: 80
agentstring
  • default: claude
  • min length: 1
  • max length: 40
baseRefstring
  • default:
  • max length: 200
modelstring
  • default:
  • max length: 265
JSON schema
{
  "type": "object",
  "properties": {
    "prompt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
    },
    "repo": {
      "type": "string",
      "maxLength": 140,
      "default": ""
    },
    "title": {
      "type": "string",
      "maxLength": 80,
      "default": ""
    },
    "agent": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40,
      "default": "claude"
    },
    "baseRef": {
      "type": "string",
      "maxLength": 200,
      "default": ""
    },
    "model": {
      "type": "string",
      "maxLength": 265,
      "default": ""
    }
  },
  "required": [
    "prompt"
  ],
  "additionalProperties": false
}

Example request

curl -X POST "https://polaris.example.com/api/v1/sessions" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "string",
  "repo": "",
  "title": "",
  "agent": "claude",
  "baseRef": "",
  "model": ""
}'

Responses

StatusMeaning
201Created

Can also answer the common errors 400, 401, 403, 404, 429. See common errors