Start an agent session
POST
/api/v1/sessionsThe prompt is its first turn. When every slot is taken it waits in line, and queuedAt is its place. Needs agents.manage.
On this page
Request body
| Field | Type | Description |
|---|---|---|
promptrequired | string |
|
repo | string |
|
title | string |
|
agent | string |
|
baseRef | string |
|
model | string |
|
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
| Status | Meaning |
|---|---|
201 | Created |
Can also answer the common errors 400, 401, 403, 404, 429. See common errors