Skip to main content

Authorize user login

API operation: Open the endpoint in Scalar

Use POST /auth to authenticate a registered user. The current public operation is User.auth.

The request supports login by email or cellphone. A password or one-time password is required according to the selected login mode. Additional fields, including notification, device-code, and verification fields, are conditional; follow the Scalar request schema rather than sending every available field.

Email and password example:

const response = await ordering.users().auth({
email: 'user@example.com',
password: '[REDACTED]'
})

Cellphone login requires a number associated with a registered user and any country-code fields required by the selected project configuration.

This guide adds usage context to the exact public POST /auth operation. Scalar remains authoritative for request fields, authentication requirements, responses, and errors.

OpenAPI reference​

Operation: POST /auth

Header parameters

NameTypeRequiredDescription
x-forwarded-forstringNo—
User-AgentstringNo—

Request body fields

NameTypeRequired
cellphoneanyNo
country_phone_codestringNo
device_codestringNo
emailanyNo
guest_tokenanyNo
notification_appanyNo
notification_provideranyNo
notification_tokenanyNo
one_time_passwordanyNo
passwordanyNo
platformstringNo
recaptcha_typestringNo
verification_codeanyNo

Responses

CodeDescription
200OK
400Bad Request (ErrorResponse)
401Unauthorized
403Forbidden (ErrorResponse)
404Not Found
429Too Many Requests (ErrorResponse)
500Internal Server Error (ErrorResponse)
503Service Unavailable (ErrorResponse)
Open this operation in the API reference