Auth API
The API authenticates with a bearer token:
Authorization: Bearer <token>| Token | Where it comes from | What it can do |
|---|---|---|
API key, indox_… (older keys ak_…) | Created in the web app under Dashboard → API keys; the value is shown once | The route families its scopes allow |
| Sign-in access token | The external_token returned by sign-in | The authenticated routes, including the account operations an API key cannot perform |
Requests without a token are served within the free tier’s quota, see Limits.
The web app sends its sign-in token automatically as a Secure, HttpOnly session cookie.
API key scopes
Each key carries scopes, and a route family accepts a key only if it holds that family’s scope:
| Scope | Route families |
|---|---|
convert | /api/v1/pdf_handler/ (except ai/), /api/v1/docs_core/, /api/v1/media_core/, /api/v1/conversion/, /api/v1/convert/, /api/v1/fonts/, /api/v1/office-editor/, and the legacy /api/v1/image_converter/, /api/v1/video_converter/, /api/v1/model/ |
ai_extract | /api/v1/pdf_handler/ai/, /api/v1/deck/ |
webhooks | /api/v1/webhooks/ |
admin | Every family above |
A new key gets convert, ai_extract and webhooks unless you choose otherwise. A key created
before scopes existed, holding only read, write, billing or user_mgmt, keeps full access.
A key without the scope a route needs is refused:
HTTP/1.1 403 Forbidden
Content-Type: application/json
{"detail": "auth.api_key_scope_missing"}The SDKs raise a dedicated error for this, see SDK errors.
Account operations need a sign-in
API keys convert files; they cannot manage the account. These operations answer 403
(API keys cannot manage the account; sign in instead.) to an API key and accept a sign-in
access token:
| Method | Path |
|---|---|
PATCH | /api/v1/user/me/ |
POST | /api/v1/user/shares/ |
DELETE | /api/v1/user/shares/{link_id}/ |
POST | /api/v1/subscription/purchase_initiate/ |
POST | /api/v1/subscription/purchase_initiate/pay-as-you-go/ |
POST | /api/v1/subscription/storage/initiate/ |
Changing the account’s email address, POST /api/v1/user/me/email-change/, also needs a
sign-in token. PATCH /api/v1/user/me/ no longer accepts email.
Sign in and two-factor codes
| Method | Path | Body | Purpose |
|---|---|---|---|
POST | /api/v1/user/auth/login/ | {"email", "password", "remember_me"} | Sign in; answers with external_token, expires_at and refresh_expires_at |
POST | /api/v1/user/auth/2fa/ | {"mfa_token", "code"} | Second step for an account with two-factor authentication |
POST | /api/v1/user/auth/refresh/ | Rotate the access token; send the refresh token as the bearer | |
POST | /api/v1/user/auth/logout/ | Sign out |
Login takes a JSON body only; any other content type answers 415
(auth.login_json_required). With remember_me the token lasts 30 days, otherwise 14.
For an account with two-factor authentication, login answers 401 with
{"code": "mfa_required", "mfa_token": "…", "detail": "…"}. Send that mfa_token and the
current code to /api/v1/user/auth/2fa/, which answers like a successful login.
curl -sS https://indox.org/api/v1/user/auth/login/ \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "…"}'Login and 2FA refusals (locked account, bad code, throttling) are listed under
Auth and rate-limit codes. The Python client wraps
this flow in login() and complete_2fa(), see
Signing in.
Identity flows (allauth headless)
Signup, email/password login, logout, and password reset are served by allauth headless under /_allauth/app/v1/ (no trailing slash):
| Method | Path | Purpose |
|---|---|---|
GET | /_allauth/app/v1/config | Enabled auth methods & providers |
POST | /_allauth/app/v1/auth/signup | Create an account |
POST | /_allauth/app/v1/auth/login | Email/password login |
GET | /_allauth/app/v1/auth/session | Current session |
DELETE | /_allauth/app/v1/auth/session | Log out |
POST | /_allauth/app/v1/auth/password/request | Request a password reset |
The allauth session token authenticates these identity endpoints, not the conversion API.
Profile & sessions (/api/v1/user/)
| Method | Path | Purpose |
|---|---|---|
GET/PATCH | /api/v1/user/me/ | Current user profile; PATCH needs a sign-in token |
POST | /api/v1/user/me/email-change/ | Change the email address; needs a sign-in token |
GET | /api/v1/user/auth/sessions/ | List active sessions |
DELETE | /api/v1/user/auth/sessions/{session_id}/ | Revoke one session |
DELETE | /api/v1/user/auth/sessions/revoke-all/ | Revoke all sessions |
See Quickstart for a worked example.