Skip to main content
The Codaclean API uses two credentials together. 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 you send to POST /token belong to 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. An ID token therefore gives access to exactly what its user can access:
  • Usually, the whole accounting firm. The token gives access to all the firm’s customers the user can see.
  • Or only one or more companies. The accounting firm can restrict a user to specific customers. The API then only returns those customers, with their mandates and files.
Restricted accounts are typically used when the end customer, rather than the accountant, uses your software.The accounting firm creates an account restricted to that customer’s company, and your software only ever sees that company’s data.
See also: Data access

Get an ID token

Call POST /token with the user’s credentials: The response contains:
The password must be Base64-encoded before you send it.Codaclean decodes it, so a plain-text password fails with 500 Authentication failed.

Refresh the ID token

The ID token is valid for 1 hour. When it expires, calls return 401. 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 without the Administrator access level do not see confidential customers.
  • Scopes control what your API key can do.
See also: Data access