Skip to main content
The Tarefy API uses JWT Bearer Token. Every protected endpoint requires the header:

Get a token

Use POST /v2/auth/login:
Response:
The token is a JWT. Its payload carries the user id, account id and permission level — there is no separate user object in the response.

Errors

Failures return the proper HTTP status and a machine-readable code:
Branch on code, never on message — messages are localized and may change.

Expiration

Login tokens expire in 30 days. When they expire, you receive:
Call /v2/auth/login again to get a new token.
For server-to-server integrations, prefer an API token over signing in with a user’s password. Create one in the app under Settings → API Tokens: you choose its permission level, it can be revoked at any time, and it is not tied to someone’s password. API tokens do not expire unless you set an expiration date.

Best practices

Never expose your token in client-side code, public repositories or logs. Anyone with the token has full account access.
  • Store tokens in a secure environment (env vars, secret manager, httpOnly cookie)
  • Use one token per integration when possible — easier to revoke
  • Rotate if you suspect a leak (just change the user’s password)

Persistent API tokens (coming soon)

Currently only session JWT tokens (24h) are supported. Persistent scoped API tokens are on the roadmap.

Common errors