# Kiosa API > REST API of Kiosa, the operating system for hospitality businesses. Base URL https://api.kiosa.ai/v1. OAuth 2.0 authorization code with PKCE. JSON with snake_case fields, ISO 8601 timestamps, errors as application/problem+json (RFC 9457). Status: partner preview. The Kiosa API connects your software to the Kiosa account of a hospitality business. Version 1 covers setting up integrations: read the business and its locations, submit credentials, map branches, disconnect. **Partner preview:** every endpoint is published as a contract and may still change before general availability. ### Authorization OAuth 2.0 authorization code flow with PKCE (S256). Your client ID is an https URL on your domain serving a client metadata document (CIMD); it is a public client without a secret. During authorization the user enters their Kiosa address; pass `login_hint=` to prefill it. Only admins of the business can consent. Access tokens are valid for 1 hour, refresh tokens rotate on every use. Tokens are issued for `resource=https://api.kiosa.ai/v1` and are valid for this API only. Revocation: `https://api.kiosa.ai/api/oauth/revoke`. The API is only open to approved, active partners: a client that is not listed gets no scope at all, not even a read scope (authorization ends with `unauthorized_client`). `integrations:write` only covers the providers in the approval. The business can turn off partner apps in Kiosa at any time. ### Errors Errors use `application/problem+json` (RFC 9457) with `type`, `title`, `status`, `detail`, `code` and `request_id`. `type` is `https://docs.kiosa.ai/en/reference/errors/#`. Branch on `code`; the docs list every code. ### Rate limits Each token may send 60 requests per minute. Every response carries `RateLimit-Policy: "default";q=60;w=60` and `RateLimit: "default";r=;t=`. Exceeding the limit returns `429` with `Retry-After` in seconds. ### Versioning The major version is part of the path. New fields, endpoints and error codes are added without a version change; ignore unknown fields. Breaking changes only ship in a new major version; the previous one keeps running for at least 12 months and is announced with the `Deprecation` and `Sunset` headers. ### Request ID Every response carries `X-Request-Id` in the format `req_` + 26-character ULID (for example `req_01JDX5Q8M3V8F2K7ZB9T4N6C1A`); errors repeat it as `request_id`. Quote it when contacting Kiosa. ## Scopes - `account:read`: Read the business, its locations and the current connection. - `integrations:read`: Read the status of the business integrations. - `integrations:write`: Hand over provider credentials, map branches and disconnect integrations. Includes integrations:read. ## OAuth endpoints - Authorization: https://api.kiosa.ai/api/oauth/authorize - Token: https://api.kiosa.ai/api/oauth/token - Revocation: https://api.kiosa.ai/api/oauth/revoke - Authorization server metadata: https://api.kiosa.ai/.well-known/oauth-authorization-server - Protected resource metadata: https://api.kiosa.ai/.well-known/oauth-protected-resource/v1 ## Endpoints ### GET /v1/me Get the connection. Returns the business that granted access, when access was granted and the granted scopes. A good first call after authorization to link the business in your system. - Operation ID: `getMe` - Scope: `account:read` - Availability: partner_preview Responses: - 200 `Me`: The connection of the token. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503) Example response 200: ```json { "account": { "id": "cm3acc0000trattoria00001", "name": "Trattoria Beispiel GmbH", "slug": "trattoria-beispiel" }, "consented_at": "2026-11-24T09:30:00+01:00", "scopes": [ "account:read", "integrations:write" ] } ``` ### GET /v1/locations List locations. Returns all locations of the business with ID, name and address. Use the IDs to map provider branches via `PUT /integrations/{provider}/branch-mappings`. - Operation ID: `listLocations` - Scope: `account:read` - Availability: partner_preview Responses: - 200 `LocationList`: All locations of the business. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503) Example response 200: ```json { "data": [ { "id": "cm3loc0000city0000000001", "name": "Trattoria City", "address": { "street": "Musterstraße 1", "postal_code": "20095", "city": "Hamburg", "country": "DE" } }, { "id": "cm3loc0000hafen000000002", "name": "Trattoria am Hafen", "address": { "street": "Hafenweg 7", "postal_code": "20457", "city": "Hamburg", "country": "DE" } } ] } ``` ### GET /v1/integrations List integrations. Returns every provider that can be managed through the API (v1: `ordio`) with a short status, including unconnected ones (`not_connected`). `writable` shows whether this client may manage the provider. More providers are added without a version change. - Operation ID: `listIntegrations` - Scope: `integrations:read` - Availability: partner_preview Responses: - 200 `IntegrationList`: All integrations of the business that can be managed through the API. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503) Example response 200: ```json { "data": [ { "provider": "ordio", "status": "needs_mapping", "writable": true, "last_import_at": null } ] } ``` ### GET /v1/integrations/{provider} Get an integration. Returns the full status of an integration: connection, initial import, last import and open issues. If nothing is connected, the status is `not_connected` (no 404). After a PUT answered with 202, poll this endpoint until the status is no longer `testing`. - Operation ID: `getIntegration` - Scope: `integrations:read` - Availability: partner_preview - Path parameter `provider`: "ordio" Responses: - 200 `Integration`: Status of the integration. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503), `not_found` (404) Example response 200: ```json { "provider": "ordio", "status": "needs_mapping", "company_id": "1234", "api_key_last4": "x9Qa", "key_expires_at": "2027-11-30T23:59:59+01:00", "connected_at": "2026-11-24T10:15:02+01:00", "initial_import": { "status": "waiting_for_mapping", "since": "2025-01-01" }, "last_import": null, "issues": [ { "code": "unmapped_branches", "detail": "1 ordio branch is not mapped to a Kiosa location yet." } ] } ``` ### PUT /v1/integrations/{provider} Connect an integration. Submits the provider credentials. Kiosa verifies them with the provider right away (key valid, all required permissions present), stores them encrypted and maps branches with an unambiguously matching name to Kiosa locations. Once every branch is mapped, the initial import starts from 1 January of the previous year. The call is idempotent: the same body changes nothing and starts no second import; a new key replaces the old one. A new `company_id` discards all existing mappings. The business sees in Kiosa that the integration was connected. - Operation ID: `putIntegration` - Scope: `integrations:write` - Availability: partner_preview - Path parameter `provider`: "ordio" - Request body: `OrdioCredentials` ```json { "api_key": "", "company_id": "1234", "key_expires_at": "2027-11-30T23:59:59+01:00" } ``` Responses: - 200 `IntegrationWithBranches`: Credentials verified and stored, including the mapping suggestion. - 202 `IntegrationWithBranches`: Verification takes longer than 10 seconds. Status `testing`; `GET /integrations/{provider}` returns the result. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503), `admin_required` (403), `provider_not_allowed` (403), `not_found` (404), `validation_failed` (422), `payload_too_large` (413), `provider_auth_failed` (422), `missing_provider_scopes` (422), `provider_unreachable` (502) Example response 200: ```json { "provider": "ordio", "status": "needs_mapping", "company_id": "1234", "api_key_last4": "x9Qa", "key_expires_at": "2027-11-30T23:59:59+01:00", "connected_at": "2026-11-24T10:15:02+01:00", "initial_import": { "status": "waiting_for_mapping", "since": "2025-01-01" }, "last_import": null, "issues": [ { "code": "unmapped_branches", "detail": "1 ordio branch is not mapped to a Kiosa location yet." } ], "branches": [ { "branch_id": "4711", "name": "Trattoria City", "mapping": "mapped", "location_id": "cm3loc0000city0000000001", "suggested_location_id": null }, { "branch_id": "4712", "name": "Trattoria am Hafen GmbH", "mapping": "unmapped", "location_id": null, "suggested_location_id": "cm3loc0000hafen000000002" }, { "branch_id": "4713", "name": "Zentrale Verwaltung", "mapping": "ignored", "location_id": null, "suggested_location_id": null } ] } ``` Example response 202: ```json { "provider": "ordio", "status": "testing", "company_id": "1234", "api_key_last4": "x9Qa", "key_expires_at": "2027-11-30T23:59:59+01:00", "connected_at": "2026-11-24T10:15:02+01:00", "initial_import": null, "last_import": null, "issues": [], "branches": [] } ``` ### DELETE /v1/integrations/{provider} Disconnect an integration. Deletes the credentials and stops running and future imports before responding. Data already imported stays in Kiosa. When you reconnect later, gaps longer than 7 days are not backfilled; the nightly sync only loads the last 7 days. If nothing is connected, the call also returns 204. This does not end the OAuth access of your client; use token revocation for that. - Operation ID: `deleteIntegration` - Scope: `integrations:write` - Availability: partner_preview - Path parameter `provider`: "ordio" Responses: - 204 (no body): Integration disconnected. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503), `admin_required` (403), `provider_not_allowed` (403), `not_found` (404) ### GET /v1/integrations/{provider}/branches List branches. Returns the branches at the provider with their mapped Kiosa location or a suggestion. If the integration is not connected, the call returns 404 `not_found`. - Operation ID: `listIntegrationBranches` - Scope: `integrations:read` - Availability: partner_preview - Path parameter `provider`: "ordio" Responses: - 200 `BranchList`: Branches at the provider. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503), `not_found` (404), `provider_unreachable` (502) Example response 200: ```json { "data": [ { "branch_id": "4711", "name": "Trattoria City", "mapping": "mapped", "location_id": "cm3loc0000city0000000001", "suggested_location_id": null }, { "branch_id": "4712", "name": "Trattoria am Hafen GmbH", "mapping": "unmapped", "location_id": null, "suggested_location_id": "cm3loc0000hafen000000002" }, { "branch_id": "4713", "name": "Zentrale Verwaltung", "mapping": "ignored", "location_id": null, "suggested_location_id": null } ] } ``` ### PUT /v1/integrations/{provider}/branch-mappings Map branches. Maps provider branches to Kiosa locations or ignores whole branches. Only the listed branches change. `location_id` must be a location of this business (see `GET /locations`). Once every branch is mapped or ignored, the status changes to `active` and the initial import starts. Mappings by working area are maintained by Kiosa. - Operation ID: `putIntegrationBranchMappings` - Scope: `integrations:write` - Availability: partner_preview - Path parameter `provider`: "ordio" - Request body: `BranchMappingRequest` ```json { "mappings": [ { "branch_id": "4712", "location_id": "cm3loc0000hafen000000002" }, { "branch_id": "4713", "ignore": true } ] } ``` Responses: - 200 `IntegrationWithBranches`: Mapping stored; integration status including branches. - Errors: `invalid_token` (401), `insufficient_scope` (403), `user_inactive` (403), `partner_not_approved` (403), `partner_suspended` (403), `partner_apps_disabled` (403), `rate_limited` (429), `internal_error` (500), `upstream_unavailable` (502), `upstream_timeout` (504), `service_unavailable` (503), `admin_required` (403), `provider_not_allowed` (403), `not_found` (404), `validation_failed` (422), `payload_too_large` (413), `mapping_conflict` (409) Example response 200: ```json { "provider": "ordio", "status": "active", "company_id": "1234", "api_key_last4": "x9Qa", "key_expires_at": "2027-11-30T23:59:59+01:00", "connected_at": "2026-11-24T10:15:02+01:00", "initial_import": { "status": "running", "since": "2025-01-01" }, "last_import": { "status": "running", "started_at": "2026-11-24T10:16:40+01:00", "finished_at": null }, "issues": [], "branches": [ { "branch_id": "4711", "name": "Trattoria City", "mapping": "mapped", "location_id": "cm3loc0000city0000000001", "suggested_location_id": null }, { "branch_id": "4712", "name": "Trattoria am Hafen GmbH", "mapping": "mapped", "location_id": "cm3loc0000hafen000000002", "suggested_location_id": null }, { "branch_id": "4713", "name": "Zentrale Verwaltung", "mapping": "ignored", "location_id": null, "suggested_location_id": null } ] } ``` ## Schemas ### Address Postal address; unknown parts are null. - `street` (string | null, required): Street and house number. - `postal_code` (string | null, required): Postal code. - `city` (string | null, required): City. - `country` (string | null, required): Country as ISO 3166-1 alpha-2 code. ### BranchList All branches at the provider. - `data` (array of ProviderBranch, required) ### BranchMapping Map a branch to a Kiosa location, or ignore the whole branch. - Variant 1: - `branch_id` (string, required): Branch ID at the provider. - `location_id` (string, required): Kiosa location of this business. - Variant 2: - `branch_id` (string, required): Branch ID at the provider. - `ignore` (true, required): Do not import this branch. ### BranchMappingRequest Changes to the branch mapping. - `mappings` (array of BranchMapping, required): Branches to change. Branches not listed keep their mapping. ### ImportState An import run. - `status` ("running" | "succeeded" | "failed", required): State of the import run. - `started_at` (string (date-time), required): Start of the run. - `finished_at` (string (date-time) | null, required): End of the run. ### Integration Full status of one integration. - `provider` ("ordio", required): Integration provider. v1 supports `ordio` only. - `status` (IntegrationStatus, required) - `company_id` (string | null, required): Company ID at the provider. - `api_key_last4` (string | null, required): Last four characters of the stored key. Kiosa never returns the key itself. - `key_expires_at` (string (date-time) | null, required): Expiry of the key, if known. - `connected_at` (string (date-time) | null, required): When the current credentials were stored. - `initial_import` (object | null, required): Initial import of the history. It starts automatically once all branches are mapped. - `last_import` (ImportState | null, required) - `issues` (array of IntegrationIssue, required): Open issues; empty when everything is fine. ### IntegrationIssue Something the business or the partner has to resolve. - `code` ("unmapped_branches" | "key_expires_soon" | "key_expired" | "provider_auth_failed" | "missing_provider_scopes" | "import_failed" | "other_staff_provider_active", required): Stable issue code. `other_staff_provider_active`: another staff system is already active for this business in Kiosa; the business contacts Kiosa to switch to ordio (the API never switches it off). - `detail` (string, required): Human-readable explanation in English. ### IntegrationList All integrations of the business. - `data` (array of IntegrationSummary, required) ### IntegrationStatus `not_connected`: no credentials stored. `testing`: Kiosa is still verifying the credentials. `needs_mapping`: connected, but at least one branch is not mapped yet. `active`: connected and fully mapped, imports run. `error`: the last test or import failed, see `issues`. Type: "not_connected" | "testing" | "needs_mapping" | "active" | "error" ### IntegrationSummary Short status of one integration. - `provider` ("ordio", required): Integration provider. v1 supports `ordio` only. - `status` (IntegrationStatus, required) - `writable` (boolean, required): `true` when this client may manage the integration through the API. - `last_import_at` (string (date-time) | null, required): End of the last successful import. ### IntegrationWithBranches Integration status including the branch mapping. - `provider` ("ordio", required): Integration provider. v1 supports `ordio` only. - `status` (IntegrationStatus, required) - `company_id` (string | null, required): Company ID at the provider. - `api_key_last4` (string | null, required): Last four characters of the stored key. Kiosa never returns the key itself. - `key_expires_at` (string (date-time) | null, required): Expiry of the key, if known. - `connected_at` (string (date-time) | null, required): When the current credentials were stored. - `initial_import` (object | null, required): Initial import of the history. It starts automatically once all branches are mapped. - `last_import` (ImportState | null, required) - `issues` (array of IntegrationIssue, required): Open issues; empty when everything is fine. - `branches` (array of ProviderBranch, required): Branches at the provider with their mapping; empty while the status is `testing`. ### Location A location (restaurant) of the business. - `id` (string, required): Kiosa location ID. Use it as `location_id` in branch mappings. - `name` (string, required): Name of the location. - `address` (Address, required) ### LocationList All locations of the business. - `data` (array of Location, required) ### Me The connection behind the access token. - `account` (object, required): The business that granted access. - `id` (string, required): Kiosa ID of the business. - `name` (string, required): Name of the business. - `slug` (string, required): Kiosa address of the business (`.kiosa.ai`). - `consented_at` (string (date-time), required): When an admin of the business granted access to this client (ISO 8601 with offset). - `scopes` (array of Scope, required): Scopes granted to this token. ### OrdioCredentials Credentials of the ordio integration. - `api_key` (string, required): ordio API key with the scopes branches:read, shifts:read, absences:read and wages:read. - `company_id` (string, required): ordio company ID. - `key_expires_at` (string (date-time), optional): Expiry of the key. Kiosa reminds the business before it expires. ### Problem RFC 9457 problem details. `title` and `detail` are always in English; localized texts per `code` are in the docs. - `type` (string (uri), required): Documentation URL of the error code: `https://docs.kiosa.ai/en/reference/errors/#`, identical in every language. - `title` (string, required): Short summary of the error code. - `status` (integer, required): HTTP status code. - `detail` (string, required): Explanation of this occurrence. - `code` ("invalid_token" | "insufficient_scope" | "user_inactive" | "partner_not_approved" | "partner_suspended" | "partner_apps_disabled" | "admin_required" | "not_found" | "validation_failed" | "rate_limited" | "provider_auth_failed" | "missing_provider_scopes" | "provider_unreachable" | "provider_not_allowed" | "mapping_conflict" | "internal_error" | "payload_too_large" | "upstream_unavailable" | "upstream_timeout" | "service_unavailable", required): Stable machine-readable error code. Branch on this, not on `title` or `detail`. - `request_id` (string, required): Same value as the X-Request-Id header: `req_` followed by a 26-character ULID. - `invalid_params` (array of object, optional): Only for `validation_failed`. - `missing_scopes` (array of string, optional): Only for `missing_provider_scopes`: scopes the provider key lacks. ### ProviderBranch A branch at the provider and its Kiosa location. - `branch_id` (string, required): Branch ID at the provider. - `name` (string, required): Branch name at the provider. - `mapping` ("mapped" | "ignored" | "unmapped", required): `mapped`: imported into `location_id`. `ignored`: not imported. `unmapped`: still open. - `location_id` (string | null, required): Kiosa location the branch is mapped to. - `suggested_location_id` (string | null, required): Suggestion for an unmapped branch, based on a matching name. ### Scope OAuth scope. Type: "account:read" | "integrations:read" | "integrations:write" ## Error codes | Code | Status | Meaning | | --- | --- | --- | | `invalid_token` | 401 | The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again. | | `insufficient_scope` | 403 | The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it. | | `user_inactive` | 403 | The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again. | | `partner_not_approved` | 403 | The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since. | | `partner_suspended` | 403 | Kiosa has suspended this client. All of its tokens are rejected with immediate effect. | | `partner_apps_disabled` | 403 | The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on. | | `admin_required` | 403 | Write calls require the user who granted access to still be an admin of the business. An admin has to grant access again. | | `not_found` | 404 | The resource does not exist or the provider is not supported by the API. | | `validation_failed` | 422 | The body or a parameter does not match the schema, for example a missing or unknown field or a location ID that does not belong to this business. invalid_params lists every affected field. | | `rate_limited` | 429 | Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry. | | `provider_auth_failed` | 422 | The provider rejected the credentials (wrong or expired key, or a key of another company). Kiosa stored nothing. | | `missing_provider_scopes` | 422 | The key works but lacks permissions Kiosa needs for the import; missing_scopes lists them. Issue a key with all permissions and submit it again. | | `provider_unreachable` | 502 | Kiosa could not reach the provider or received an unexpected response. Retry later; repeating the PUT is idempotent. | | `provider_not_allowed` | 403 | This client may not write integrations of this provider. Each partner is approved only for the providers agreed with Kiosa. | | `mapping_conflict` | 409 | The mapping references branches that no longer belong to the connected company, for example because the credentials changed in the meantime. Fetch the branches again and resend the mapping. | | `internal_error` | 500 | An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support. | | `payload_too_large` | 413 | The request body exceeds 64 KB. Kiosa did not process the request. | | `upstream_unavailable` | 502 | The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent. | | `upstream_timeout` | 504 | The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent. | | `service_unavailable` | 503 | Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry. |