Skip to content

OAuth reference ​

Endpoints ​

MethodPathAuthPurpose
POST/auth/oauth/authNoneClient credentials grant
POST/auth/oauth/tokenNoneExchange a code or refresh
GET/auth/oauth/clientBearer (login session)Client details for the consent screen
POST/auth/get-one-time-tokenBearer (user session)Mint a one-time token

Hosts:

EnvironmentHost
Productionhttps://api.bito.uz
Devhttps://api.systematicdev.uz

Rate limit on /auth/oauth/auth, /auth/oauth/token and /auth/oauth/client: 20 requests per minute per IP. /auth/get-one-time-token is not rate-limited.

On the Integration API, webhook/subscribe and webhook/unsubscribe accept 1 request per second.

What Bito sends you ​

EventMethodSent toPayload
InstallPOSTyour redirect_uri{ code, client_id, account_id }
UninstallPOSTyour revoke_access_hook_uri{ account_id }
Data changePOSTeach webhook destination{ collection_name, action, id, organization_id }

The first two are signed with your client_secret (see Install & uninstall hooks for the X-Bito-Signature verification); the third is covered in Data webhooks.

Response envelope ​

Every Bito response — success or failure — uses the same envelope.

Success

json
{
    "code": 0,
    "message": "Success",
    "messages": { "uz": "...", "ru": "...", "en": "Success" },
    "data": {},
    "time": "2025-01-15T10:30:00.000Z"
}

Error

json
{
    "code": 401,
    "message": "Unauthorized user",
    "messages": { "uz": "...", "ru": "...", "en": "Unauthorized user" },
    "time": "2025-01-15T10:30:00.000Z"
}

code is 0 on success. On failure it carries the error code, and data is absent. Branch on code, never on the text of message, which is localized.

Common errors ​

HTTPErrorWhat it meansFix
401UnauthorizedMissing or malformed Authorization headerSend Bearer <access_token>
401Token expiredThe access token is past its 24 hoursRefresh
401UnauthorizedThe session behind the token was terminatedRe-authorize. A secret rotation does exactly this.
400Invalid credentialsclient_id and client_secret do not match, or the code was already usedCheck the secret; request a fresh code
400Client not foundNo client with that client_idCheck the id you copied at creation
400Auth code expiredMore than 20 minutes passedRestart the flow
400Invalid scopeA requested scope is not a known scope valueFix the scope value
429Too many requestsMore than 20 auth calls in a minute from one IPBack off; refresh on expiry, not per request

Bito 2.0 Integration API