login
Public: no authentication required.
Signs in with an email and password. It returns tokens and a session token and sets sign-in cookies for web clients; when a second factor is required it returns a temporary token to finish with verifyTwoFactor. Rate-limited per IP address, and repeated failed attempts lock the account for a while. A failed sign-in returns one generic error that does not say whether the email has an account. No sign-in needed.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation Login($loginInput: LoginInput!) {
login(loginInput: $loginInput) {
accessToken
expiresIn
mustChangePassword
organizationId
partnerId
refreshToken
organization {
id
code
postalCode
registrationNumber
name
status
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation Login($loginInput: LoginInput!) {\n login(loginInput: $loginInput) {\n accessToken\n expiresIn\n mustChangePassword\n organizationId\n partnerId\n refreshToken\n organization {\n id\n code\n postalCode\n registrationNumber\n name\n status\n }\n }\n}",
"variables": {
"loginInput": {
"email": "string",
"password": "string"
}
}
}
EOF
Variables:
{
"loginInput": {
"email": "string",
"password": "string"
}
}
Response:
{
"data": {
"login": {
"accessToken": "string",
"expiresIn": 0,
"mustChangePassword": true,
"organizationId": "string",
"partnerId": "string",
"refreshToken": "string",
"organization": {
"id": "string",
"code": "string",
"postalCode": "string",
"registrationNumber": "string",
"name": "string",
"status": "string"
}
}
}
}
login(
loginInput: LoginInput!
): AuthResponse!
Arguments
login.loginInput ● LoginInput! non-null input
The email, the password, the organization subdomain and optional second-factor code and device settings.
Type
AuthResponse object
The result of a sign in.