curl --request POST \
--url https://apiv2.example.com/auth/email/verify \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}
'import requests
url = "https://apiv2.example.com/auth/email/verify"
payload = {
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.doe@example.com',
nonce: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
code: '123456'
})
};
fetch('https://apiv2.example.com/auth/email/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/auth/email/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.doe@example.com',
'nonce' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/auth/email/verify"
payload := strings.NewReader("{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/auth/email/verify")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/auth/email/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"tokenType": "Bearer",
"expiresIn": 604800,
"userId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Verify email login
Verifies an email login by validating the verification code sent to the email address.
On success, returns an OAuth2-compatible token response with:
accessToken: JWT token for authenticating subsequent API requeststokenType: Always “Bearer”expiresIn: Token lifetime in secondsuserId: The authenticated user’s identifier
Use the access token in the Authorization header: Authorization: Bearer {accessToken}
curl --request POST \
--url https://apiv2.example.com/auth/email/verify \
--header 'Content-Type: application/json' \
--data '
{
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}
'import requests
url = "https://apiv2.example.com/auth/email/verify"
payload = {
"email": "john.doe@example.com",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"code": "123456"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john.doe@example.com',
nonce: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
code: '123456'
})
};
fetch('https://apiv2.example.com/auth/email/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiv2.example.com/auth/email/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'john.doe@example.com',
'nonce' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'code' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiv2.example.com/auth/email/verify"
payload := strings.NewReader("{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiv2.example.com/auth/email/verify")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.example.com/auth/email/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john.doe@example.com\",\n \"nonce\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"code\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"tokenType": "Bearer",
"expiresIn": 604800,
"userId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}{
"message": "<string>",
"code": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"property": "<string>",
"suggestion": "<string>"
}
],
"hint": "<string>"
}Body
Request to verify an email login by providing the verification code sent to the email address.
The email address used to initiate the login.
"john.doe@example.com"
The nonce returned from the start login request.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
The 6-digit verification code sent to the email address.
^[0-9]{6}$"123456"
Response
Login verified successfully. Returns access token for API authentication.
OAuth2-compatible token response containing the access token for authenticating API requests.
JWT access token for authenticating API requests. Include in the Authorization header as "Bearer {accessToken}".
The type of token issued. Always "Bearer" for JWT tokens.
Bearer "Bearer"
Number of seconds until the access token expires.
604800
The unique identifier of the authenticated user.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"