Skip to main content

Contact Verification API

The Contact Verification API allows clients to programmatically send verification codes and confirm contact methods for the authenticated user. These endpoints are used by the profile UI to manage email, mobile number, and home number verification inline.

Authentication

All Contact Verification API endpoints require a valid JWT token. See API Authentication for details.

Base URL: /api/v4/ContactVerification

Send Verification Code

Sends a verification code to the specified contact method for the authenticated user. For email, a verification email is sent. For mobile and home numbers, an SMS is sent.

POST /api/v4/ContactVerification/SendVerificationCode

Request Body:

FieldTypeRequiredDescription
TypeintYesContact verification type: 0 = Email, 1 = MobileNumber, 2 = HomeNumber

Response:

FieldTypeDescription
SuccessboolWhether the code was sent successfully
MessagestringDescriptive message (e.g., "A verification code has been sent." or an error message)

Error Scenarios:

HTTP StatusCondition
200 OKCode sent successfully, or a descriptive error in the response body
429 Too Many RequestsRate limit exceeded (max 3 sends per contact method per hour)
400 Bad RequestInvalid contact type or no contact value on file

Example Request:

curl -X POST \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
"https://api.resgrid.com/api/v4/ContactVerification/SendVerificationCode" \
-d '{"Type": 0}'

Example Response:

{
"Data": {
"Success": true,
"Message": "A verification code has been sent."
},
"Status": "success"
}

Confirm Verification Code

Validates a verification code entered by the user and, if correct and not expired, marks the contact method as verified.

POST /api/v4/ContactVerification/ConfirmVerificationCode

Request Body:

FieldTypeRequiredDescription
TypeintYesContact verification type: 0 = Email, 1 = MobileNumber, 2 = HomeNumber
CodestringYesThe 6-digit numeric verification code

Response:

FieldTypeDescription
SuccessboolWhether the verification was successful
MessagestringDescriptive message (e.g., "Verification successful." or an error message)

Error Scenarios:

HTTP StatusCondition
200 OKVerification confirmed or a descriptive error in the response body
429 Too Many RequestsDaily attempt limit exceeded (max 5 attempts per contact method per day)
400 Bad RequestInvalid contact type or missing code

Example Request:

curl -X POST \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
"https://api.resgrid.com/api/v4/ContactVerification/ConfirmVerificationCode" \
-d '{"Type": 1, "Code": "482910"}'

Example Response (Success):

{
"Data": {
"Success": true,
"Message": "Verification successful."
},
"Status": "success"
}

Example Response (Failure):

{
"Data": {
"Success": false,
"Message": "Verification failed. Please check the code and try again."
},
"Status": "success"
}

Contact Verification Types

ValueNameDescription
0EmailEmail address verification (sends verification email)
1MobileNumberMobile number verification (sends SMS)
2HomeNumberHome number verification (sends SMS)

Rate Limits

LimitDefaultDescription
Max sends per hour3Maximum verification code sends per contact method per hour
Max attempts per day5Maximum verification code entry attempts per contact method per day
Code expiry30 minutesHow long a verification code remains valid

When a rate limit is reached, the API returns an appropriate error message. Daily attempt counters reset at midnight UTC.

Verification State Model

Each contact method on a user profile has a tri-state verification value:

ValueStateCommunications
nullGrandfatheredAllowed (pre-existing users)
falsePendingBlocked until verified
trueVerifiedAllowed

For more details on how verification affects dispatches, notifications, and messaging, see the Contact Method Verification configuration guide.