Documentation
Check Endpoint
Call the single and batch decision endpoints with concrete request and response shapes from the local backend contracts.
Authentication
Send a project API key as a bearer token.
Authorization: Bearer <project-api-key>
Content-Type: application/json
If the API key is missing or invalid, the current auth middleware responds with plain text:
unauthorized
Single check request
{
"subject": "user:alice",
"feature": "secret",
"action": "reveal",
"tenant": "project_123",
"resource": "prod/api/STRIPE_SECRET_KEY"
}
Single check response
Field rules
subjectis requiredfeatureis requiredactionis requiredtenantis optional, but if present it must not be an empty stringresourceis optional, but if present it must not be an empty string
Use resource for path-style checks such as dev/api/DATABASE_URL, staging/api/RESEND_API_KEY, prod/payment/STRIPE_SECRET_KEY, or wildcard export checks like dev/api/*.
Fail-closed internal evaluation response:
{
"allowed": false,
"reason": "error"
}
Batch checks
Use POST /v1/check/batch when the subject and tenant are the same across several requested permissions.
{
"subject": "user:alice",
"tenant": "tenant_acme",
"checks": [
{ "feature": "secret", "action": "reveal", "resource": "dev/api/DATABASE_URL" },
{ "feature": "secret", "action": "export", "resource": "dev/api/*" },
{ "feature": "secret", "action": "reveal", "resource": "prod/payment/STRIPE_SECRET_KEY" }
]
}
Batch response:
Operational notes
- Batch access is plan-gated in the backend
- Each batch item is billed as an individual decision
- Unknown JSON fields are rejected by strict decoding
- Invalid request bodies return a JSON
errorresponse POST /v1/checkreturns{ "allowed": false, "reason": "error" }when evaluation fails internallyPOST /v1/check/batchreturns{ "error": "..." }for request-level failures such as invalid bodies or plan-gated accessPOST /v1/check/batchkeeps200 OKfor per-item evaluation failures and sets the affectedresults[].reasontoerror- auth failures still return plain-text
unauthorized