Skip to content

Authentication

Every call except login requires the header:

Authorization: Bearer <token>

POST /Auth/LogIn with username (email or username) and password. The response contains:

Field What it is
twoFactorStep 0 login complete; 1 authenticator code missing; 2 authenticator not yet registered.
token JWT to send in every call.
refreshToken Used by the web application to renew the session.
businessGroupLogged, companyLogged Business group and company of the session. Endpoints read and write in this company, unless they accept a CNPJ.

Login has a per-user attempt limit. Repeated wrong passwords block new attempts for a while.

If twoFactorStep is 1, the response includes twoFactorChallenge. Complete the login with:

Terminal window
curl -X POST https://api-prod.scoreplan.com.br/Auth/LogInTwoFactor \
-H "Content-Type: application/json" \
-d '{"challenge": "<twoFactorChallenge>", "code": "123456"}'

For automated integrations, prefer an integration user without mandatory two-factor authentication: the authenticator code requires a person.

When the token expires, the API responds 401. Log in again and retry the call.

  • The business group’s contract must include the API of the module being called; otherwise the response is 401 with You don't have access.
  • Each endpoint applies its own module’s rules (for example, writing indicator values requires an administrator user).