Developers
Authentication
Sign in, send the token with each request, check who you are and sign out.
Sign in with your email and password to receive an access token. Send that token with every other request.
Sign in#
POST /api/auth/login
| Field | Type | Required |
|---|---|---|
email | string | Yes |
password | string | Yes |
timezone | string | No |
A successful sign-in returns 200 with the token and the signed-in user. The response is shown here with the fields shortened.
{
"message": "Login successful",
"accessToken": "<token>",
"user": {
"id": "…",
"email": "you@example.com",
"name": "…",
"role": "…",
"roleLabel": "…",
"department": "…"
}
}Use the token#
Send the token in the Authorization header on every other request.
Authorization: Bearer <accessToken>Browsers do not need to do this. A successful sign-in also sets an HttpOnly auth_token cookie, and the API accepts either one.
Check who you are#
GET /api/auth/me returns the signed-in user. It is a quick way to test that a token still works.
Sign out#
POST /api/auth/logout ends the session. After that, the token is refused with 401.
Failed sign-ins#
| Situation | What you get |
|---|---|
| Too many failed sign-ins | 429 with Too many login attempts, please try again later. The limit is 20 failed attempts per 15 minutes for the same address and email. |
| Account locked after repeated failures | 429. Wait, or ask an administrator for help. |
| Missing, expired or revoked token on another call | 401. Sign in again. |
Successful sign-ins do not count towards the limit.
Other password endpoints#
| Endpoint | Used for |
|---|---|
POST /api/auth/forgot-password | Start a password reset by email. |
POST /api/auth/reset-password | Finish a reset with the emailed token. |
POST /api/auth/setup-password | Set a password when you accept an invitation. |
POST /api/auth/change-password | Change your password while signed in. |
Need more help?
Can’t find what you need? Talk to the team.