sessclone

Ingest

POST /api/ingest — what the Collector sends, and what it gets back.

The endpoint every Collector reports to. You do not need it to use SessClone: the Collector is its only client. It is documented for anyone writing another one, and for reading a deployment's logs.

The schemas below are generated from the same zod schemas the route validates against, so this page cannot describe a payload the route would refuse. The spec itself is packages/shared/openapi/ingest.json.

Send posts a real Turn to this deployment

The playground below is live. With a valid API key, Send records the request body as a Turn in that key's Org, on this deployment, exactly as a Collector's report would be. The key stays in the form only: it is not saved in the browser, so a reload asks for it again.

POST
/api/ingest
AuthorizationBearer <token>

A Member API key, sk_…, created on the Keys page of the dashboard. It decides the Member and the Org every Turn is filed under; the payload names neither.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/ingest" \  -H "Content-Type: application/json" \  -d '{    "device": {      "key": "string"    },    "reports": [      {        "sessionId": "string",        "agentId": "string",        "project": {          "key": "string",          "remote": "string"        },        "cursor": {          "messageId": "string",          "byteOffset": 0        },        "turns": [          {            "sessionId": "string",            "agentId": "string",            "messageId": "string",            "model": "string",            "serviceTier": "string",            "speed": "string",            "inferenceGeo": "string",            "clientVersion": "string",            "timestamp": "2019-08-24T14:15:22Z",            "cwd": "string",            "gitBranch": "string",            "requestId": "string",            "complete": true,            "usage": {              "inputTokens": 0,              "outputTokens": 0,              "cacheReadInputTokens": 0,              "cacheCreationInputTokens": 0,              "cacheCreation5mInputTokens": 0,              "cacheCreation1hInputTokens": 0,              "thinkingTokens": 0,              "webSearchRequests": 0,              "webFetchRequests": 0            },            "entryUuids": [              "string"            ]          }        ]      }    ]  }'
{  "accepted": [    {      "sessionId": "string",      "agentId": "string",      "turns": 0,      "cursor": {        "messageId": "string",        "byteOffset": 0      }    }  ]}