Verification
Endpoints for email and phone verification.
Email and phone verification is mandatory to access certain features.
Verification Flow
Request code
Call /request_confirmation/ specifying the type (email or phone).
Receive code
User receives a 6-digit code via SMS or email.
Verify code
Send the code to the corresponding endpoint (/verify_email/ or /verify_phone/).
Confirmation
The email_verified or phone_verified field updates to true.
Request Verification Code
Sends a verification code to user’s email or phone.
Endpoint
POST /request_confirmation/Headers
Authorization: Bearer [ACCESS_TOKEN]
Content-Type: application/json
x-api-key: [API_KEY]Request
{
"type": "email"
}Response
{
"message": "Verification code sent"
}The code expires in 5 minutes. If it expires, request a new one.
Verify Phone
Confirms the user’s phone number.
Endpoint
POST /verify_phone/Headers
Authorization: Bearer [ACCESS_TOKEN]
Content-Type: application/json
x-api-key: [API_KEY]Request
{
"code": "123456"
}Response
{
"message": "Phone verified successfully"
}The profile’s phone_verified field updates to true.
Verify Email
Confirms the user’s email address.
Endpoint
POST /verify_email/Headers
Authorization: Bearer [ACCESS_TOKEN]
Content-Type: application/json
x-api-key: [API_KEY]Request
{
"code": "654321"
}Response
{
"message": "Email verified successfully"
}The profile’s email_verified field updates to true.
Verification Status
Check verification status at the GET /user/ endpoint:
{
"phone_verified": true,
"email_verified": false
}Status Indicators
| Status | Icon | Meaning |
|---|---|---|
true | ✅ | Successfully verified |
false | ❌ | Pending verification |
Tip: Verify both (email and phone) to unlock all features.
Complete Example
1. Request code for email
curl -X POST https://dev.backend.colurs.co/request_confirmation/ \
-H "Authorization: Bearer [TOKEN]" \
-H "x-api-key: [API_KEY]" \
-H "Content-Type: application/json" \
-d '{"type": "email"}'2. User receives email
User receives an email with code 123456.
3. Verify the code
curl -X POST https://dev.backend.colurs.co/verify_email/ \
-H "Authorization: Bearer [TOKEN]" \
-H "x-api-key: [API_KEY]" \
-H "Content-Type: application/json" \
-d '{"code": "123456"}'4. Verification complete
The email_verified field is now true.