Skip to content

Edge API (OpenAPI)

This page is generated from openapi.yaml at build time. The machine-readable spec is a deliverable of this package.

API version: 0.1

KeyPatternUsed for
Publishable (uv_pk_...)Body/query keyPOST /v1/sdk/bootstrap, POST /v1/sdk/responses, POST /v1/dismissals
Secret (uv_sk_...)Authorization: Bearer or X-UserVane-KeyPOST /v1/sdk/tokens, GET /v1/sdk/pending-scores, POST /v1/sdk/pending-scores/ack, privacy

The secret key is server-only. Never ship it to the browser.

Bootstrap surveys, suppression, and unbound show-tokens

Returns active survey definitions, the server-authoritative suppression set for the respondent, and per-survey single-use show-tokens (when the respondent is eligible). Caps and quiet period are decided here only (issue-time). Public (publishable) key.

Auth: publishable key

NameInDescription
keyqueryPublishable key (also accepted in body)
userIdqueryRespondent id (also accepted in body)
FieldTypeRequiredDescription
keystringPublishable key
userIdstring
traitsobject
FieldTypeRequiredDescription
surveysarrayyes
suppressionarrayyesSurvey ids this respondent has answered or dismissed
showTokensobjectsurveyId -> single-use show-token; missing means gated

Status codes: 200, 400, 401, 403, 429

Submit a survey response (token-verified)

Ingests a rating after verifying the single-use show-token. Caps are never enforced at submit; a valid unused token is always accepted. Publishable key in body or query. Optional correlation fields (sessionId, observationId) must match token-attested values when the token was session-bound.

Auth: publishable key

NameInDescription
keyqueryPublishable key (also accepted in body)
FieldTypeRequiredDescription
showTokenstringyes
surveyIdstringyes
ratingintegeryesOuter bound; per-type range enforced after survey load
textstring
followUpRequestedboolean
userIdstring
traitsobject
keystringPublishable key
sessionIdstringMust match token-attested session when bound
observationIdstring
taskTypestringUntrusted display metadata for PM segmentation
identityKind"identified" | "anon-device" | "anon-conversation"
FieldTypeRequiredDescription
oktrueyes
idstringyes
atstringyes

Status codes: 201, 400, 401, 403, 404, 409, 429

Record a dismissal (token-verified)

Records that the respondent dismissed the ask and adds the survey to suppression. Same token rules as response submit. Publishable key.

Auth: publishable key

NameInDescription
keyquery
FieldTypeRequiredDescription
showTokenstringyes
surveyIdstringyes
userIdstringyes
keystring
FieldTypeRequiredDescription
oktrueyes
idstringyes
atstringyes

Status codes: 201, 400, 401, 403, 404, 429

Mint session-bound show-tokens (server-only)

Mints v2 show-tokens bound to the provided sessionId (and optional observationId / taskType). Auth is secret key only; a publishable key Bearer fails. Same gating as bootstrap (suppression, quiet period, monthly cap, per-survey max). Empty tokens means gated, not an error. Never call from the browser.

Auth: secret key

FieldTypeRequiredDescription
respondentIdstringyes
sessionIdstringyesAuthoritative server session id (Langfuse / AI SDK)
observationIdstring
taskTypestring
surveyIdstringWhen set, only mint for this active survey
FieldTypeRequiredDescription
tokensobjectyessurveyId -> v2 show-token bound to sessionId
suppressionarrayyes
issuedAtstringyes

Status codes: 200, 400, 401, 429

Poll linked scores awaiting Langfuse push

Tenant-scoped queue of linked responses with score_state=pending (and optionally failed). Serves verbatim PII for this project only. Secret key only. Used by @uservane/langfuse-push.

Auth: secret key

NameInDescription
limitqueryPage size (server-capped)
includeFailedqueryWhen true, also return previously failed rows
cursorqueryOpaque keyset cursor from a prior nextCursor
FieldTypeRequiredDescription
scoresarrayyes
nextCursorstring

Status codes: 200, 400, 401, 429

Ack delivered or failed pending scores

Adapter reports per-id delivered or failed. Updates only this project’s rows; foreign ids are a silent no-op. Secret key only.

Auth: secret key

FieldTypeRequiredDescription
resultsarrayyes
FieldTypeRequiredDescription
oktrueyes
updatedintegeryes

Status codes: 200, 400, 401, 429

Export responses (DSAR / admin)

Secret-key export of response rows. Optional filters by respondentId, email (imported rows; hashed server-side to imp_), and surveySlug.

Auth: secret key

NameInDescription
respondentIdqueryLive SDK userId or known imp_ hash
emailqueryNatural identity for imported Delighted rows
surveySlugquery
FieldTypeRequiredDescription
projectIdstringyes
exportedAtstringyes
countintegeryes
responsesarrayyes

Status codes: 200, 400, 401, 404

Erase responses (DSAR / purge)

Secret-key erasure. Modes:

  • respondent: respondentId and/or email (deletes responses and dismissals; retains hashed suppression so never-re-prompt survives)
  • survey: surveySlug alone (per-survey purge)
  • account: account=true (full project purge)

Auth: secret key

NameInDescription
respondentIdquery
emailquery
surveySlugquery
accountqueryFull account purge when set
FieldTypeRequiredDescription
oktrueyes
mode"respondent" | "survey" | "account"yes
respondentIdsarray
responsesDeletedinteger
dismissalsDeletedinteger
suppressionRetainedinteger
surveySlugstring
notestring

Status codes: 200, 400, 401, 404

The OpenAPI 3 document lives at the package root as openapi.yaml and is copied into the static build under /openapi.yaml.