Get an access token

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

FieldRequiredDescription
usernameYesEmail of the user
passwordYesPassword of the user
organizationIdYesId 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 resultContent
accessTokenThe access token (JWT). Send it in the Authorization: Bearer {accessToken} header of the other requests.
accessTokenExpirationNumber of seconds before the access token expires
accessTokenExpireAtDate and time when the access token expires (UTC)
refreshTokenThe 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: username or password is missing or empty, organizationId isn'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: organizationId doesn't exist.
  • 500: the identity provider has an internal error, or can't be reached.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Email and password of the user, and the organization to sign in to.

uuid
required

Id of the organization to sign in to: the access token is tied to it. Returns 400 when it isn't a valid UUID, and 404 when it doesn't exist.

string
required

Password of the user. Can't be empty.

string
required

Email of the user. Can't be empty.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json