POST /auth/passwordless/send
Passwordless — send login code (email or SMS)
Passwordless — send login code (email or SMS)
/auth/passwordless/sendRequest body
NestAuthPasswordlessSendRequestDto
| Field | Type | Required | Description |
|---|---|---|---|
identifier | string | required | Email or phone (per `channel`) Example: user@example.com |
channel | "email" | "sms" | required | emailsms |
tenantId | string | optional |
Examples
Example
{
"identifier": "user@example.com",
"channel": "email",
"tenantId": "string"
}Responses
200
MessageResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
message | string | required | Response message |
Example response
{
"message": "string"
}400Validation failed (bad input).
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}401Missing, invalid, or expired authentication.
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}Try it
curl -X POST 'https://api.example.com/auth/passwordless/send' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{"identifier":"user@example.com","channel":"email","tenantId":"string"}'