Rensei docs

Open a program-ledger record for an external key, idempotently.

Creates the program a coordinator records decisions and handoffs against. The external key - an epic identifier or a campaign slug - is unique within the organization: a repeat call returns the existing program with created set to false. An origin session is optional, so a coordinator running off-platform with no session-ledger node can open one; when supplied, a project-scoped program must name that session project. A cross-project program requires an org-wide credential, and external keys are unique per project for project-scoped programs and org-wide for cross-project ones. An external key is immutable once claimed: programs are append-only and there is no rename or delete. The author is derived from the authenticating principal.

POST
/api/cli/programs

Authorization

headerAuthorizationBearer <rsk_live_*>

Rensei API key presented as Authorization: Bearer rsk_live_. Required API-key scopes are recorded per operation in x-rensei-required-scopes.

Request Body

application/json
  1. body
externalKey*string
Length1 <= length <= 512
title*string
Length1 <= length <= 512
scope*|
originSessionId?string
Length1 <= length <= 256

Response Body

The program already existed for this external key.

application/json
  1. response
ledgerVersion*string
programVersion*string
program*
created*boolean
Example Request
curl -X POST 'https://app.rensei.ai/api/cli/programs' \  -H 'Content-Type: application/json' \  -d '{  "externalKey": "string",  "title": "string",  "scope": {    "kind": "project",    "projectId": "string"  }}'
Example Response
{  "ledgerVersion": "rensei.session-ledger/v1alpha1",  "programVersion": "rensei.session-ledger.program/v1alpha1",  "program": {    "ledgerVersion": "rensei.session-ledger/v1alpha1",    "programVersion": "rensei.session-ledger.program/v1alpha1",    "programId": "string",    "externalKey": "string",    "title": "string",    "scope": {      "kind": "project",      "projectId": "string"    },    "origin": {      "sessionId": "string",      "graphId": "string",      "projectId": "string",      "phase": "string",      "stateVersion": 1    },    "createdByPrincipalRef": "string",    "author": {      "kind": "human",      "id": "string"    },    "createdAt": "2019-08-24T14:15:22Z"  },  "created": true}