Swap login credentials for a token
POST
/auth/loginRequest body
application/jsonemailstringpasswordstringResponses
200Authentication successful
expiresInnumberrequiredTTL for the token in seconds
expiresstringrequiredISO8601 compliant timestamp for the token expiry
tokenstringrequiredready to use token for API queries
refreshTokenstringrequiredrefresh token to be used with `/auth/refresh`/ endpoint
userobjectrequiredFirebase-type user object obtained by decoding the JWT token
Show propertiesHide properties
objecttracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
400Bad Request (invalid input)
messagestringrequirederrorsopenApiErrorItem[]requiredmin items 1
Show propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
413Payload Too Large (JSON body exceeds 400kb limit)
messagestringrequirederrorsopenApiErrorItem[]requiredShow propertiesHide properties
Array of
openApiErrorItemopenApiErrorItemtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
500Internal server error
messagestringrequiredtracestring | nullrequireddeprecatedAlways null. Deprecated; may be removed in a future release.
Request
curl -X POST "/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "my-email@example.com",
"password": "my-password"
}'const response = await fetch("/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "my-email@example.com",
"password": "my-password"
})
});Response
{
"expiresIn": 3600,
"expires": "2020-01-19T06:00:00+01:00",
"token": "ey...",
"refreshToken": "A0...",
"user": {},
"trace": null
}{
"message": "request.body should have required property 'XYZ'",
"errors": [
null
],
"trace": null
}{
"message": "Payload Too Large",
"errors": [
null
],
"trace": null
}{
"message": "Internal Server Error",
"trace": null
}