Verification endpoint
This endpoint is used for the following operations:
- Verifying the phone number that you set in the registration request, using the responses from the registration endpoint.
- Verifying the phone number or recovery code that is used for authentication.
HTTP request
POST https://{instance}.mauth.nevis.cloud/api/v1/users/{userId}/verification
Path parameters
Parameter | Type | Required/Optional | Description |
---|---|---|---|
userId | UUID | required | Path parameter that represents the user that is the subject of this registration operation. This UUID is part of the API endpoint, as each user has a verification endpoint. |
Request body parameters
Parameter | Type | Required/Optional | Description |
---|---|---|---|
code | string | required | Either a multi-digit code that the user received on their phone as a text message for phone number registration, or an alpha-numeric code containing dashes, received from the recovery codes registration endpoint. |
statusToken | string | required for SMS authentication | Status token returned by the registration response. |
channel | string | required for recovery code authentication | Represents the authentication channel. You can set it to the following values: sms , recovery . |
Example HTTP request
- Verify phone number registration
- Verify recovery code authentication
cURL code sample to verify the phone registration
curl -v -X POST https://$instance.mauth.nevis.cloud/api/v1/users/$userId/verification \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $access_key" \
-d "{ \"code\":\"$code\",
\"statusToken\":\"$statusToken\" }"
cURL code sample to verify an authentication with recovery code
curl -v https://$instance.mauth.nevis.cloud/api/v1/users/$userId/verification \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $access_key" \
-d "{ \"code\":\"$code\",
\"channel\":\"recovery\" }"
HTTP response
The response is either an HTTP/1.1 200 if the verification is successful, or an HTTP/1.1 4xx if the verification fails.
HTTP/1.1 200 OK