Rensei docs
API ReferenceWorker Protocol

Poll for queued work

Atomically pops and pre-claims work items from the priority queue (ZPOPMIN). Also returns inbox messages for the worker's active sessions. Workers that receive `preClaimed: true` must NOT make a separate claim call. Runtime-JWT callers also receive `gitCredentials` (short-lived GitHub PAT) and optionally `batchWork` (code-survival scan items, gated on the `code-survival-scan` capability).

GET
/api/workers/{id}/poll

Authorization

workerJwt
AuthorizationBearer <token>

Runtime JWT minted by the platform at worker registration. Three-segment dotted string. Claims include {jti, proj, org, sub (=workerId), reg, scope[]}. Use on all post-registration worker endpoints.

In: header

Path Parameters

id*string

Worker ID (must match the sub claim of the runtime JWT).

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/workers/string/poll"
{
  "work": [
    {
      "sessionId": "string",
      "issueId": "string",
      "issueIdentifier": "string",
      "priority": 0,
      "queuedAt": 0,
      "prompt": "string",
      "providerSessionId": "string",
      "workType": "research",
      "sourceSessionId": "string",
      "projectName": "string",
      "repository": "string",
      "kits": {}
    }
  ],
  "inboxMessages": {
    "property1": [
      {
        "id": "string",
        "type": "stop",
        "sessionId": "string",
        "payload": "string",
        "userId": "string",
        "userName": "string",
        "createdAt": 0,
        "lane": "urgent"
      }
    ],
    "property2": [
      {
        "id": "string",
        "type": "stop",
        "sessionId": "string",
        "payload": "string",
        "userId": "string",
        "userName": "string",
        "createdAt": 0,
        "lane": "urgent"
      }
    ]
  },
  "hasInboxMessages": true,
  "preClaimed": true,
  "claimedSessionIds": [
    "string"
  ],
  "gitCredentials": [
    {
      "token": "string",
      "cloneUrl": "string",
      "expiresAt": "2019-08-24T14:15:22Z"
    }
  ],
  "batchWork": [
    {}
  ]
}
{
  "error": "Session not found"
}
{
  "error": "Session not found"
}