younifyd
Menu

Login

Login

POST/auth/login

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Login action (under Authentication).
  3. Fill in the fields below, then reference the result from later steps as {{login.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

emailstringrequired

Email address of the user you're logging in as. for.

passwordstring (password)required

Password of the user.

modestring

Whether to retrieve the refresh token in the JSON response, or in a `httpOnly` cookie.

One ofjsoncookiesessionDefault "json"

otpstring

The user's one-time-password (if MFA is enabled).

json
{
  "email": "admin@example.com",
  "password": "password",
  "mode": "json",
  "otp": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{login.response.data.<field>}}.

dataobject
access_tokenstring
expiresinteger
refresh_tokenstring
json
{
  "data": {
    "access_token": "eyJhbGciOiJI...",
    "expires": 900,
    "refresh_token": "yuOJkjdPXMd..."
  }
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?