Skip to main content
Most API requests need an access token for your Itoflow account, sent in the Authorization header:
Replace 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.
Most people don’t need a token. If you use Claude, Codex or another AI assistant, connect Itoflow MCP and sign in once in your browser. Your client handles authentication for you.

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
Put the token straight into an environment variable, so it stays out of your shell history:
If sign-in fails, the script prints the reason and the variable is left empty, so check it before you continue. The code expires after a few minutes. Poll no faster than the 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 returns 401, get a new one without signing in again:
The script sends the saved refresh token to the sign-in service, saves the new refresh token it gets back, and prints the new access token. Each refresh returns a new refresh token and the old one may stop working, so always use the newest. If the refresh fails, run 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:
Replace the following:
  • REFRESH_TOKEN: the newest refresh token you saved.
  • CLIENT_ID: the clientId from GET /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.json with 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.
The API checks the token’s issuer, audience and expiry on every request, then checks that your account may use the resource you asked for. See Security at Itoflow for how we protect your data.

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 to https://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.