post
https://api.jmapcloud.io/api/ss/rest/v1/authenticate
Signs a user in to an organization with their email and password, and returns an access token and a refresh token.
Required role: none. This endpoint doesn't need an access token.
Fields
| Field | Required | Description |
|---|---|---|
username | Yes | Email of the user |
password | Yes | Password of the user |
organizationId | Yes | Id of the organization to sign in to (see below) |
Only users who sign in with an email and a password can use this endpoint: users who sign in with an external identity provider (single sign-on) can't.
Organization
The access token is tied to the organization in organizationId: the endpoints under /organizations/{organization} require organization to be the organization of the access token.
Tokens
Field of result | Content |
|---|---|
accessToken | The access token (JWT). Send it in the Authorization: Bearer {accessToken} header of the other requests. |
accessTokenExpiration | Number of seconds before the access token expires |
accessTokenExpireAt | Date and time when the access token expires (UTC) |
refreshToken | The refresh token. Keep it secret: it gets new access tokens with POST /refresh-token, without the password. |
The access token can't be revoked: it stays valid until it expires. Get a new one with POST /refresh-token before it expires.
When it fails
400:usernameorpasswordis missing or empty,organizationIdisn't a valid UUID, or the identity provider refuses the request for another reason, such as too many failed attempts. The message gives the reason.401: the identity provider refuses the user, for example a blocked user.403: wrong email or password, or the sign-in is refused, for example when multi-factor authentication is required.404:organizationIddoesn't exist.500: the identity provider has an internal error, or can't be reached.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…