Authorization header:
ACCESS_TOKEN with your access token.
Some routes need no token, such as GET /auth/client-config, GET /pricing/catalog, GET /fx-rates, GET /strategies/public and the public share routes. The API coverage index shows the authentication for every endpoint.
Get an access token
Itoflow uses the OAuth 2.0 device authorization flow. Your program asks for a short code, you approve that code in your browser, and the program receives an access token and a refresh token. This Python script uses only the standard library. It prints the approval link to the terminal, waits while you approve, then prints the access token. It saves the refresh token to~/.config/itoflow/credentials.json, readable only by you, and never prints it.
get_token.py
interval the sign-in service returns; if it answers slow_down, wait longer between polls.
Refresh an expired token
Access tokens are short-lived. When a request returns401, get a new one without signing in again:
python3 get_token.py again to sign in.
To refresh from your own code, send these form fields to the tokenEndpoint from GET /auth/client-config:
REFRESH_TOKEN: the newest refresh token you saved.CLIENT_ID: theclientIdfromGET /auth/client-config.
Keep tokens safe
- Keep tokens out of source files, URLs, logs, screenshots and bug reports.
- Keep the refresh token inside the program that manages the session; the script stores it in
~/.config/itoflow/credentials.jsonwith owner-only permissions. Only the access token goes to the API. - The client ID, an ID token and a refresh token are not API tokens. The API rejects them.
- Don’t copy tokens out of browser cookies or another app’s credential files.
Try requests in these docs
Read-only endpoints have a Send button in the API reference; the reference overview lists them. Get an access token and paste it into the bearer field. Requests go straight from your browser tohttps://api.itoflow.ai. The docs site sends no cookies and does not proxy the request. Clear the field when you finish, and don’t use a shared browser.
Errors
401: the token is missing, expired or not an Itoflow access token. Refresh it or sign in again. Don’t retry the same token in a loop.403: the token is valid, but your account can’t use this resource, or your plan doesn’t include it.