Skip to content

Fill a prompt's variables and get the text, without sending anything​

POST
/api/prompts/{promptId}/render

Substitutes the person's answers into the prompt's body and returns the text. It writes nothing: no message is sent, no thread is touched, and the answer is in no log. Allowed for the caller's own prompts and for the ones shared with them. answers is the Choices answer to the prompt's variables: one entry per variable, once each, in variable order, {id, values, other?, text?}; a prompt has no free box, so a note is refused. Every rule is in prompts-v1.md with vectors: a choice renders as its label, several as the labels in option order joined by ", ", a text verbatim, confirm as yes or no, a number, a scale point and a date as sent, a rank as 1. A; 2. B; an optional variable left alone renders as the empty string (its default is never used); nothing is trimmed and a value is never read again for references. The text is at most 32,768 bytes (422 rendered_too_long, decided before anything is built). With revision the prompt must still be at it (409 stale_revision: read it again). An answer that does not fit is 422 invalid_answer with the first refusal: question (a variable's id, or * for the whole answer) and rule (unknown, unexpected, required, too_many, too_few, not_offered, repeated, out_of_order, too_long, grammar, below_min, above_max, off_step, not_a_permutation). The checks run in one order: 401, 403 no_access, 415, the shape (400 bad_request), 404, 409, 422.

Authorizations​

bearerToken

A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.

Type
HTTP (bearer)
or
dpopToken

A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".

Type
HTTP (DPoP)
or
proxyIdentity

Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.

Type
API Key (header: X-Auth-Request-Email)

Request Body​

JSON
{
  
"revision": "string",
  
"answers": [
  
  
{
  
  
  
"id": "string",
  
  
  
"values": [
  
  
  
],
  
  
  
"other": "string",
  
  
  
"text": "string"
  
  
}
  
],
  
"note": "string"
}

Responses​

The text

JSON
{
  
"text": "string",
  
"revision": "string"
}

Samples​

Powered by VitePress OpenAPI