Pistis
API referenceChanging a session

Branch a session

POST
/sessions/{id}/branch

A new session with the conversation up to atSeq, and the files as they were then.

Authorization

bearer
headerAuthorizationBearer <token>

An API token

Path Parameters

id*string

A session id

Request Body

application/json
  1. body
atSeq*integer

The last entry to keep

Range1 <= value
requestId?string

Response Body

The new session

application/json
  1. response
sessionId*string
requestId*string

The caller's key, as given

principal*string

Whose session it is

meta*

Labels fixed at creation: up to 16, key ^[a-z][a-z0-9_]{0,31}$, value up to 256 characters. agent picks an agent, agent_revision pins one, repo picks repositories (<connection>:<path>, comma-separated, up to 10), pool picks a pool of your machines. Keys starting with slack_ or flow are Pistis's own and refused.

skills*
createdAt*integer

Created (milliseconds since the epoch)

endedAt?integer

Ended: sandbox deleted, input refused, conversation kept (milliseconds since the epoch)

model*
parent?||
Example Request
curl -X POST 'http://127.0.0.1:7777/sessions/ses_6c1f2a0b9d3e4f5a6b7c/branch' \  -H 'Content-Type: application/json' \  -d '{  "atSeq": 1}'
Example Response
{  "sessionId": "string",  "requestId": "string",  "principal": "string",  "meta": {    "property1": "string",    "property2": "string"  },  "skills": {    "property1": "string",    "property2": "string"  },  "createdAt": 0,  "endedAt": 0,  "model": {    "id": "string",    "thinking": "off"  },  "parent": {    "kind": "branch",    "sessionId": "string",    "atSeq": 0  }}