API reference
This is the reference of release 0.6.3, written from the openapi.json that the package @vivd-catalyst/api-contract ships. A running instance serves the reference of the operations it runs itself at /api/v1/docs, and the document behind it at /api/v1/openapi.json. Both ask for a signed-in person or an access token.
Every operation under /api/v1 of release 0.6.3, and the unversioned readiness probe /ready. Every error answers with the envelope ApiErrorResponse; its code is the stable part, its correlationId names the request in the instance's log.
Credentials
sessionCookie(cookiebetter-auth.session_token): The session of a person signed in through/api/auth, the mount owned by the sign-in library. Over HTTPS the browser carries the cookie as__Secure-better-auth.session_token. A changing request with this cookie must come from the instance's own origin or an allowed one.sessionToken(Authorization: Bearer …): A session token a trusted backend obtained for one of its users fromsession_tokens.issue.accessToken(Authorization: Bearer …): A short-lived access token of a service principal, obtained fromaccess_tokens.exchangewith an API key.apiKey(Authorization: Bearer …): An API key of a service principal. It is presented only toaccess_tokens.exchange.serverCredential(headerx-server-credential): The instance's server credential, held by a trusted backend.
Errors
BAD_REQUEST: The request cannot be read.UNAUTHENTICATED: No credential was presented, or the credential is not valid.FORBIDDEN: The caller lacks the scope or the right this operation requires.NOT_FOUND: The resource does not exist, is not visible to the caller, or the instance runs without this operation.CONFLICT: The request conflicts with the current state of the resource.VALIDATION_FAILED: Path, query or body do not match the operation's schema.RATE_LIMITED: The caller sent too many requests of this operation's rate class.details.retryAfterSecondsand theRetry-Afterheader give the seconds to wait. The numbers are the instance's, set underrateLimitsin its release config.INTERNAL: The instance failed. The message never carries details.FORBIDDEN: The caller lacks the scope or the right this operation requires.POLICY_DENIED: The instance's policy does not allow this operation from here.details.operationnames it.GUARDRAIL_BLOCKED: A guardrail refused the call.details.guardrailIdnames it.DECLINED: The person asked to approve the call declined it.details.bynames them,details.commentholds their reason where they gave one.CONFLICT: The request conflicts with the current state of the resource.IDEMPOTENCY_KEY_REUSED: TheIdempotency-Keywas already used for another operation or another input. Send a new key.OPERATION_IN_PROGRESS: The first call with thisIdempotency-Keyhas not ended, or it was interrupted and its outcome is not known (details.interruptedistrue).details.operationRunIdnames its run. An interrupted call is never run again under its key: check what it changed, then send a new key.OPERATION_EXPIRED: The call waited for an approval until it expired, and nothing was executed. Call again with a new key.OUTPUT_NOT_RETAINED: The call with thisIdempotency-Keycompleted, and its answer was too large to keep. Read the result from what the call changed.
Answer headers
Operation-Run-Id: The id of the Operation Run that records this call. Set on every answer of a call that got as far as a run, a refusal and a failure included.Location: Where the Operation Run of a call that waits for an approval is read.Idempotent-Replayed:truewhen the answer is the recorded one of an earlier call with the sameIdempotency-Key.