Rensei docs
API ReferenceWorker Protocol

Explicitly claim a pre-queued session

Allows a worker to claim a session that was polled but not auto-claimed (e.g. after a `nack` retry). Returns the `QueuedWork` item and short-lived git credentials on success. Workers that receive `preClaimed: true` from the poll response must NOT call this endpoint.

POST
/api/sessions/{id}/claim

Authorization

headerAuthorizationBearer <JWT>

Short-lived worker runtime JWT minted by the platform. Claims bind the worker, project, organization, registration, and scopes.

Path Parameters

id*string

Request Body

application/json
  1. body
workerId*string

Response Body

Claim result.

application/json
  1. response
claimed*true
Value intrue
session*

Full session state object stored in Redis.

work*
gitCredentials*array<>
Example Request
curl -X POST 'https://app.rensei.ai/api/sessions/string/claim' \  -H 'Content-Type: application/json' \  -d '{  "workerId": "string"}'
Example Response
{  "claimed": true,  "session": {    "linearSessionId": "string",    "trackerSessionId": "string",    "issueId": "string",    "issueIdentifier": "string",    "providerSessionId": "string",    "worktreePath": "string",    "status": "pending",    "createdAt": 0,    "updatedAt": 0,    "workerId": "string",    "queuedAt": 0,    "claimedAt": 0,    "priority": 0,    "promptContext": "string",    "organizationId": "string",    "workType": "research",    "agentId": "string",    "projectName": "string",    "provider": "string",    "totalCostUsd": 0,    "inputTokens": 0,    "outputTokens": 0,    "lastToolName": "string",    "lastToolCalledAt": 0,    "toolCallCount": 0  },  "work": {    "sessionId": "string",    "issueId": "string",    "issueIdentifier": "string",    "priority": 0,    "queuedAt": 0,    "prompt": "string",    "providerSessionId": "string",    "workType": "research",    "workTypeRole": "intake",    "sourceSessionId": "string",    "projectName": "string",    "repository": "string",    "ref": "string",    "repositoryDeclaration": {      "protocol": "session-root-v1",      "repositories": [        {          "source": {            "repository": "string",            "ref": "string"          },          "role": "primary",          "authority": "mutable"        }      ]    },    "repositoryDeclarationNotDelivered": {      "reason": "harness_does_not_attest_session_root_v1",      "extraRepositories": 0    },    "gitIdentity": {      "name": "string",      "email": "string",      "committerName": "string",      "committerEmail": "string"    },    "gitTrailers": [      "string"    ],    "kits": {}  },  "gitCredentials": [    {      "token": "string",      "cloneUrl": "string",      "expiresAt": "2019-08-24T14:15:22Z"    }  ]}