The accounting firm is always derived from the ID token.
You never send it as a parameter: a user only ever sees their own firm’s data.
User accounts and token scope
The credentials sent toPOST /token are those of a Codaclean user account.
The accounting firm creates and manages these accounts itself, in its MyCodaclean platform: it chooses each user’s access level and which customers they can access.
The scope of an ID token is therefore that of its user:
- Usually, the whole accounting firm. The token gives access to all the firm’s customers the user can see.
- Or one or more companies only. The accounting firm can restrict a user to specific customers. The API then only returns those customers, with their mandates and files.
Get an ID token
CallPOST /token with the user’s credentials:
The response contains:
Refresh the ID token
The ID token is valid for 1 hour. When it expires, calls return401.
Call POST /token again with the refresh token only:
The response contains a new
idToken. It does not contain a new refreshToken: keep using the one you have.
The refresh token is valid for 30 days. When it expires, log in again with the username and password.
Token errors
On this endpoint, a
500 usually means wrong credentials or an invalid refresh token, not a server failure.Who can use the API
- Users with the Portal only access level cannot use the API: their calls return
401. - Users who are not Administrator do not see confidential customers.
- What your API key may do is controlled by scopes.

