Request conventions are described in Making Requests.
Pagination
| Parameter | Default | Description |
|---|---|---|
page | 1 | 1-based page number |
page_size | 20 | Items per page. Maximum 100 |
sort_by | none | Field to sort by. Endpoint-specific |
sort_order | asc | asc or desc |
total_items counts the records paged over, not the items returned. An endpoint
that filters after paging can return a short or empty page while later pages
still hold items. Continue while current_page < total_pages.
Status and error codes
Every error body has errors and message, and most have a code. A refusal
that carries structured data, such as the amount owed on a 402, adds
details. Branch on the status first and on code where there is one: many
400, 403, 404 and 409 responses carry no code, and their message is
written for a person.
| Status | code | Meaning |
|---|---|---|
400 | none, or invalid_value | The request is well formed but refused: a value out of range, a state that does not allow the action |
401 | varies, e.g. invalid_credentials | Missing, invalid or expired token. Refresh or sign in again |
402 | payment_required | The action needs a payment. details carries the amount and currency |
403 | insufficient_scopes | The token lacks a scope the endpoint requires |
403 | none | The token's user has no role that allows this |
403 | forbidden_not_authorized | The caller is the wrong actor: admitting somebody else without the authority |
404 | none, or a specific code below | Not found |
409 | none, or a specific code below | Conflicts with the current state |
410 | resync_required | A check-in manifest delta is too far behind; fetch the full manifest |
422 | validation_error | The body or parameters failed the schema. errors maps each field to its message |
429 | rate_limit_exceeded | See Retry-After |
500 | internal_error | Error on Davi's side |
502 | upstream_unavailable | A service Davi depends on did not answer. Retry later |
A record you cannot see answers 404 on some endpoints and 403 on others,
depending on whether the record's existence is checked first. Treat both as
"not available to this token".
An unknown path or a method a path does not take answers FastAPI's own
{ "detail": "..." } instead of the envelope.
The OAuth 2.0 endpoints add the RFC 6749 fields, error and
error_description, to the same envelope. A 429 from them carries only the
envelope.
Specific codes
code | Status | Raised when |
|---|---|---|
identifier_unresolved | 404 | The supplied identifier matched no wallet or user |
idempotency_conflict | 409 | An admit's idempotency key was reused for a different person |
already_checked_in | 409 | Two admits for the same person raced, and this one lost |
forbidden_not_authorized | 403 | Admitting somebody else without the authority to do so |
POST /sessions/{session_slug}/admit does not use error statuses for refusals
at the door. Every gate that turns somebody away, including closed doors and
hours, answers 200 with decision: "blocked" and a blocked_reason. See
Run Activities and Check-ins for the
statuses it does return.
Rate limits
Requests are counted over a sliding window: an allowance refills continuously rather than resetting on the minute. Authenticated buckets are keyed on user and client together, so traffic from another application the same user has authorized does not count against yours.
| Bucket | Limit |
|---|---|
| Reads | 300 / minute |
| Writes | 60 / minute |
| Expensive | 20 / minute |
| Unauthenticated | 30 / minute, per IP and per path |
Expensive operations
The expensive bucket is a fixed list of routes, reads among them:
| Route | Charged | Reason |
|---|---|---|
POST /sessions/{session_slug}/admit | per call | Records attendance at a door |
POST /rewards/{reward_slug}/claim | per call | Ledger write |
POST /rewards/{reward_slug}/redeem | per call | Ledger write |
POST /rewards/{reward_slug}/propagate | per call | Ledger write |
POST /rewards/{reward_slug}/trigger | per call | Ledger write |
POST /organizations/{organization_slug}/cards | per item | Takes cards into inventory, up to 20 per call |
PATCH /organizations/{organization_slug}/membership-tiers/{tier_uuid} | per call | Can reprice every membership on the tier |
POST /organizations/{organization_slug}/membership-tiers/{tier_uuid}/memberships/move | per call | Moves every membership on the tier |
POST /activities/{activity_slug}/sessions/batch | per call | Creates a run of sessions in one statement |
GET /users/search | per call | Searches every account |
GET /sessions/{session_slug}/checkin-manifest | per call | Builds the offline door manifest |
GET /sessions/{session_slug}/checkin-manifest/display | per call | Builds the offline door manifest |
GET /sessions/{session_slug}/checkin-manifest/delta | per call | Builds the offline door manifest |
POST /organizations/{organization_slug}/cards is the only endpoint charged per
item: twenty cards in one request spend twenty of the expensive allowance. The
batch cap and the bucket are both 20, so one full batch uses the whole minute's
allowance. A session batch is one charge however many dates it creates.
Per-endpoint overrides
These endpoints have their own limits in addition to the buckets. Where both apply, the tighter one decides.
| Endpoint | Limit | Keyed on |
|---|---|---|
POST /oauth2/token | 20 / minute | client_id + IP |
POST /oauth2/token (failed auth) | 5 / minute | IP |
GET /oauth2/authorize | 60 / minute | IP |
POST /oauth2/introspect | 100 / minute | client_id |
POST /oauth2/revoke | 30 / minute | client_id |
| Ledger writes signed by one wallet | 100 / hour | The sending wallet |
Rewards are sent from the issuing organization's wallet, so every redemption an organization issues, from any integration and the dashboard alike, shares that organization's 100 an hour.
Headers
Every successful response carries these headers, as does a 429 from a
bucket:
| Header | Meaning |
|---|---|
RateLimit-Limit | The bucket's allowance |
RateLimit-Remaining | What is left in the current window |
RateLimit-Reset | On a 429, seconds until a request will be allowed. Otherwise the window length |
RateLimit-Policy | The policy, e.g. 300;w=60 |
Retry-After | On a 429 only. Seconds to wait |
The same values are also sent under the older X-RateLimit-* names. An error
response other than a 429 carries none of them, and a 429 from a
per-endpoint limit carries only Retry-After.
A 429 is refused before the request runs. Retrying after Retry-After needs
no reconciliation of state.
Caching an access token for its lifetime, rather than requesting one per call, is the largest saving on the token endpoint's allowance.
Next
- Making Requests: the conventions behind these values.
- Request Scopes: what a
403for a missing scope means.