Quickstart
From client to your first API call in 10 minutes, using curl.
By the end of this page you have an access token and call GET /v1/me. You need a sandbox business (see Sandbox) and a user with the TENANT_ADMIN role in that business. The contract is published. Calls are possible once we activate your sandbox.
1. Create a client#
Kiosa uses a Client ID Metadata Document for partner apps. Your client ID is an https URL on your own domain. A JSON document lives at that URL:
{
"client_id": "https://partner.example/.well-known/kiosa-client.json",
"client_name": "My partner app",
"redirect_uris": ["https://partner.example/kiosa/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"token_endpoint_auth_method": "none"
}The client is public and uses PKCE; there is no client secret. The API is only open to clients that Kiosa has listed and activated as partners. Without this approval you get no scope at all, not even a read scope: Kiosa shows an error page and does not redirect back to you. The write scope integrations:write only covers the providers in your approval.
2. Prepare PKCE#
CODE_VERIFIER=$(openssl rand -base64 48 | tr -d '=+/' | cut -c1-64)
CODE_CHALLENGE=$(printf '%s' "$CODE_VERIFIER" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')
echo "$CODE_CHALLENGE"3. Start the login#
Open this URL in a browser. The restaurateur lands on the Kiosa page "Your Kiosa address", signs in and consents.
https://api.kiosa.ai/api/oauth/authorize
?response_type=code
&client_id=https%3A%2F%2Fpartner.example%2F.well-known%2Fkiosa-client.json
&redirect_uri=https%3A%2F%2Fpartner.example%2Fkiosa%2Fcallback
&scope=account%3Aread
&resource=https%3A%2F%2Fapi.kiosa.ai%2Fv1
&state=<random-value>
&code_challenge=<CODE_CHALLENGE>
&code_challenge_method=S256You may add login_hint=<slug> to prefill the Kiosa address. The page does not skip the prompt.
After consent, Kiosa redirects to your redirect_uri with code and your state. Check that state matches your request.
4. Exchange the code for a token#
curl -X POST https://api.kiosa.ai/api/oauth/token \
-d grant_type=authorization_code \
-d code="$CODE" \
-d redirect_uri="https://partner.example/kiosa/callback" \
-d client_id="https://partner.example/.well-known/kiosa-client.json" \
-d code_verifier="$CODE_VERIFIER" \
-d resource="https://api.kiosa.ai/v1"The response contains an access_token (valid for 1 hour) and a refresh_token. Store both securely; see Refresh and revoke tokens.
5. Make your first call#
curl https://api.kiosa.ai/v1/me \
-H "Authorization: Bearer $ACCESS_TOKEN"The response names the business (ID, name and slug), when access was granted (consented_at) and the granted scopes. The exact schema is in the reference. Every response carries the X-Request-Id header. Quote it when you contact support.
When something goes wrong#
Errors arrive as application/problem+json. The code field is stable, and the error codes explain each one.