Data API: Authentication, limits and errors
This article is for developers calling the Xpoda Data API. It explains the base URL, how to send the key, the limits, and how errors are reported.
Base URL
https://{your-xpoda-service}/api/v1/{moduleId}
{your-xpoda-service}is the address of your Xpoda Service, for exampleservice.example.com. Studio shows the full URL on the Data API Developer guide tab.{moduleId}is the number of the Studio module (project) the key was created in. A key works only for its own module; another number gives404 project_not_found.
All paths in these articles are relative to the base URL. For example GET /forms/stock-items/records means GET https://service.example.com/api/v1/7/forms/stock-items/records.
Sending the key
Send the key in a header on every request, in either form:
Authorization: Bearer xpk_...
X-Api-Key: xpk_...
- Never put the key in the URL. A request with the key in the query string is refused with
400 key_in_query, because URLs end up in logs and browser history. - Requests must use HTTPS; plain HTTP is refused with
403 https_required. - Keep the key on a server. A key in browser or mobile app code is visible to everyone who uses the app.
- Treat the key like a password: store it in a secret store or environment variable, not in source code.
The key carries the rights of its API user. There is no way to act as another user: the API ignores any user, ticket or customer information in the request.
Request and response format
- Bodies are JSON: send
Content-Type: application/json. Other content types are refused with415 unsupported_media_type. - A request body may be at most 1 MB.
- Responses are UTF-8 JSON.
- Field names in JSON are the form's column names, as listed by
GET /forms/{form}/schema.
| Type in the schema | JSON value | Example |
|---|---|---|
| string | string | "Steel bolt M8" |
| integer | number without decimals | 42 |
| number | number | 12.5 (never "12,5") |
| boolean | true or false | true |
| string, format date-time | ISO 8601 string | "2026-10-26" or "2026-10-26T14:30:00" |
| string, format uuid | GUID string | "1751e7ab-34dc-46fa-a097-17377da234ca" |
Dates are returned as yyyy-MM-ddTHH:mm:ss.fff in the Xpoda server's local time, without a time zone, because that is how Xpoda stores them.
Limits
| Limit | Value |
|---|---|
| Requests per minute, per key | 600 unless the key or the installation sets another value. Above it you get 429 rate_limited with a Retry-After header (seconds). |
| Records per page | 50 by default, at most 500. |
| Request body | 1 MB. |
| Query time | 30 seconds per database query. |
There is no daily quota.
Errors
Errors use the standard problem details format (application/problem+json, RFC 9457):
{
"type": "https://docs.xpoda.com/inbound-api/errors#validation_failed",
"title": "Unprocessable content",
"status": 422,
"code": "validation_failed",
"detail": "Some fields are not valid.",
"errors": [
{ "field": "Price", "message": "Expected a number." },
{ "field": "lines[1].Quantity", "message": "Required." }
]
}
- Branch your code on
code: it never changes.detailis a sentence for people and may change. errorsappears when individual fields are wrong, with one entry per field.- Unexpected server errors return
500 internal_errorwith no internal details; the details are written to the Xpoda Service log.
Error codes
| Status | code | Meaning and what to do |
|---|---|---|
| 400 | invalid_query | The filter, sort, fields or expand parameter is wrong. detail says where. |
| 400 | invalid_paging | page is below 1 or pageSize is out of range. |
| 400 | invalid_body | The body is not valid JSON, or not a JSON object. |
| 400 | key_in_query | The key was sent in the URL. Send it in a header. |
| 400 | invalid_idempotency_key | The Idempotency-Key header is longer than 200 characters. |
| 401 | missing_key | No key was sent. |
| 401 | invalid_key | The key is wrong or unknown. |
| 401 | key_revoked | The key was revoked in Studio. Ask for a new key. |
| 401 | key_expired | The key's expiry date has passed. |
| 403 | https_required | The request was made over plain HTTP. |
| 403 | ip_not_allowed | The calling IP address is not in the key's allowed list. |
| 403 | service_user_inactive | The key's API user was deactivated. |
| 403 | scope_missing | The key does not have this permission (read, create, update, delete) for the form. |
| 403 | form_not_in_menu | The form is not in the API user's menu. |
| 403 | form_authority | The API user's form authorities do not allow this operation. |
| 404 | project_not_found | The module number in the URL is not the key's module. |
| 404 | form_not_found | No form with this API name is available to the key. |
| 404 | record_not_found | No record with this id. |
| 404 | api_disabled | The Data API is switched off on this installation. |
| 409 | request_in_progress | A request with the same Idempotency-Key is still running. Retry shortly. |
| 412 | precondition_failed | The record changed after you read it. Read it again and retry with the new ETag. |
| 413 | body_too_large | The body is over 1 MB. |
| 415 | unsupported_media_type | The body is not sent as application/json. |
| 422 | validation_failed | Unknown fields, wrong types, missing required values or read-only fields. See errors. |
| 422 | action_rejected | A Record Control rule of the form refused the change. detail has the form's message. |
| 422 | save_rejected | The form's save refused the record (for example a database rule). detail has the message. |
| 422 | delete_rejected | The record could not be deleted. |
| 422 | idempotency_key_reused | The Idempotency-Key was already used with a different body. |
| 428 | precondition_required | An update or delete was sent without If-Match. |
| 429 | rate_limited | Too many requests. Wait the number of seconds in Retry-After. |
| 500 | internal_error | Unexpected error. Retry later; if it persists, contact support with the time of the request. |
Retrying
- Safe to retry after a pause:
429,500,409 request_in_progress, and network errors onGET. - For
POST, send anIdempotency-Keyso a retry after a network error does not create the record twice (see Data API: Writing records). - Do not retry
4xxerrors unchanged: fix the request first.