Kiosa API kiosa.ai

Refresh and revoke tokens

Lifetime, refresh rotation and revocation of tokens.

Lifetime#

TokenValidity
Access token1 hour
Refresh token90 days from issuance; every new refresh token starts at 90 days again

There is no hard upper limit. If you refresh at least every 90 days, you never have to reconnect. You can revoke at any time.

Refresh#

bash
curl -X POST https://api.kiosa.ai/api/oauth/token \
  -d grant_type=refresh_token \
  -d refresh_token="$REFRESH_TOKEN" \
  -d client_id="https://partner.example/.well-known/kiosa-client.json" \
  -d resource="https://api.kiosa.ai/v1"

The response contains a new access token and a new refresh token. Replace both. The old refresh token is invalid afterwards.

Rotation and reuse#

Refresh tokens rotate on every use. If you use a refresh token that was already exchanged, Kiosa treats this as reuse and revokes the whole token family. You then have to reconnect. So persist the new token securely before you discard the old one, and never refresh from two processes at the same time.

Revoke#

bash
curl -X POST https://api.kiosa.ai/api/oauth/revoke \
  -d token="$REFRESH_TOKEN" \
  -d client_id="https://partner.example/.well-known/kiosa-client.json"

The restaurateur can also revoke apps in Kiosa under "Connected apps". If Kiosa suspends a partner, all of its tokens are invalid immediately.

Revoking does not disconnect an existing integration; see Connect a business.

Token errors#

A missing, expired or revoked token gets a 401. The WWW-Authenticate header points to the protected resource metadata (RFC 9728). The token endpoints themselves answer in the OAuth format of RFC 6749, not as Problem Details.