Verify your customers with SMS one‑time codes (OTP) and approval links, driven entirely from your own software. This is the developer reference for the VOCPhone Account Validator.
Just want to run checks by hand? Use the portal guide instead: Account Validator.
All endpoints use JWT authentication. First create Developer Credentials in the portal (Developer Options → Developer Credentials → + Add — see Setup API Access), then exchange them for a token.
Base URL
https://portal.vocphone.com/api/v1
Get a token
curl -X POST https://portal.vocphone.com/api/v1/authentication \
-H "Content-Type: application/json" \
-d '{"username": "your-api-user", "password": "your-password"}'
{
"success": true,
"token": "eyJ0eXAiOiJKV1Q...",
"expire_at": "2026-06-11 08:00:00"
}
Send the token on every request:
Authorization: Bearer eyJ0eXAiOiJKV1Q...
All data is automatically scoped to the account the token belongs to — you only ever see your own authenticators and validations.
An authenticator is a reusable validation profile. Create as many as you need for different use cases.
curl -X POST https://portal.vocphone.com/api/v1/authenticators \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Verification",
"timeout_seconds": 300,
"message_template": "Your verification code is: {otp}. Approve here: {link}",
"webhook_url": "https://your-app.com/webhooks/validation",
"webhook_secret": "your-chosen-secret-min-16-chars"
}'
Response (201)
{
"success": true,
"data": {
"id": 1,
"name": "Customer Verification",
"timeout_seconds": 300,
"message_template": "Your verification code is: {otp}. Approve here: {link}",
"webhook_url": "https://your-app.com/webhooks/validation",
"email_notification": null,
"lookup_caller_id_url": null,
"lookup_mobile_number_url": null,
"lookup_timeout_seconds": 5,
"is_active": true,
"webhook_secret": "your-chosen-secret-min-16-chars",
"created_at": "2026-06-11T08:00:00+10:00",
"updated_at": "2026-06-11T08:00:00+10:00"
}
}
⚠️
webhook_secretis only returned on create and on regenerate. Store it securely — you need it to verify incoming webhooks. If you omit it, one is generated for you.
| Field | Required | Default | Description |
|---|---|---|---|
name |
Yes | — | Display name for this authenticator. |
timeout_seconds |
No | 300 | How long the OTP is valid (60–3600). |
message_template |
No | (see below) | Custom SMS template (max 500 chars). |
webhook_secret |
No | auto‑generated | Your HMAC‑SHA256 secret (min 16 chars). |
webhook_url |
No | — | URL to receive validation event webhooks. |
email_notification |
No | — | Email address for validation notifications. |
lookup_mobile_number_url |
No | — | Webhook URL to resolve a mobile number dynamically. |
lookup_caller_id_url |
No | — | Webhook URL to resolve a caller's number dynamically. |
lookup_timeout_seconds |
No | 5 | Timeout for lookup webhooks (1–10). |
Use single braces. (The portal UI hint shows {{otp}}, but the SMS engine substitutes single‑brace tokens — use {otp}.)
| Variable | Becomes |
|---|---|
{otp} |
the 6‑digit verification code |
{link} |
the approval/rejection link URL |
{minutes} |
expiry time in minutes |
{account_id} |
the customer identifier you provided |
Default template (used when message_template is omitted):
Your verification code is: {otp}
Or approve/reject here: {link}
This code expires in {minutes} minutes.
GET /api/v1/authenticators # list
GET /api/v1/authenticators/{id} # get one
PUT /api/v1/authenticators/{id} # update — send only the fields you're changing
DELETE /api/v1/authenticators/{id} # deactivate (soft); existing validations keep working
webhook_secretis never included in list or get responses.
POST /api/v1/authenticators/{id}/regenerate-secret
Returns the new secret. The old one stops working immediately — update your webhook handler right away.
{ "success": true, "data": { "id": 1, "webhook_secret": "new-64-char-hex-string" } }
You can also set a specific secret via update:
PUT /api/v1/authenticators/{id}
{ "webhook_secret": "your-new-secret-min-16-chars" }
curl -X POST https://portal.vocphone.com/api/v1/validations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"authenticator_id": "1",
"customer_id": "CUST-555",
"mobile_number": "61412345678"
}'
Response (201)
{
"success": true,
"data": {
"validation_instance_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "created",
"expires_at": "2026-06-11T08:05:00+10:00"
}
}
| Field | Required | Description |
|---|---|---|
authenticator_id |
Yes | The authenticator to use (string). |
customer_id |
No | Your identifier for the person being validated. |
mobile_number |
No* | Mobile in E.164 format, e.g. 61412345678. |
caller_phone_number |
No* | For caller‑ID lookup scenarios. |
* Either mobile_number or a configured lookup webhook must be able to resolve the number.
curl -X POST https://portal.vocphone.com/api/v1/validations/VALIDATION_UUID/otp \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"otp": "123456"}'
Verified (200)
{
"success": true,
"data": {
"validation_instance_id": "a1b2c3d4-...",
"status": "approved",
"decision_source": "otp"
}
}
Wrong code (200)
{
"success": true,
"data": {
"validation_instance_id": "a1b2c3d4-...",
"status": "created",
"attempts_remaining": 4,
"message": "Invalid OTP"
}
}
After 5 failed attempts the validation is automatically rejected.
Send
otpas a string of exactly 6 digits ("123456", not123456).
POST /api/v1/validations/VALIDATION_UUID/resend
There is a 30‑second cooldown between sends. Within the cooldown you get 429 with a retry_after (seconds). On success the response includes next_resend_available_at.
GET /api/v1/validations/VALIDATION_UUID
{
"success": true,
"data": {
"validation_instance_id": "a1b2c3d4-...",
"authenticator_id": "1",
"customer_id": "CUST-555",
"mobile_number": "+61412345678",
"status": "approved",
"final": true,
"decision_source": "otp",
"reason_code": null,
"expires_at": "2026-06-11T08:05:00+10:00",
"created_at": "2026-06-11T08:00:00+10:00",
"resolved_at": "2026-06-11T08:01:30+10:00"
}
}
The final boolean tells you whether the result is settled — use it to stop polling. Poll every ~2–3 seconds while final is false.
GET /api/v1/validations?status=approved&per_page=20
Returns a paginated list (data + meta with current_page, per_page, total, last_page). Filterable by any status value below.
| Status | Final | Description |
|---|---|---|
created |
No | Validation created, SMS being sent. |
message_sent |
No | SMS delivered, waiting for a response. |
approved |
Yes | Verified via OTP or approval link. |
rejected |
Yes | Customer rejected, or max attempts exceeded. |
expired |
Yes | Validation timed out. |
rate_limited |
Yes | Rate limit exceeded. |
insufficient_balance |
Yes | Account balance too low. |
delivery_failed |
Yes | SMS could not be delivered. |
system_failed |
Yes | Internal system error. |
decision_source is one of otp, link, or system.
Every validation SMS includes an approve/reject link (hosted at auth.vocphone.com). When the customer taps it and chooses, the validation resolves automatically and your webhook fires — no API call is needed from your side. The status simply transitions to approved or rejected with decision_source: "link".
If you set webhook_url on an authenticator, we POST a signed JSON body to it for these events:
validation.createdvalidation.message_sentvalidation.approvedvalidation.rejectedvalidation.expiredvalidation.delivery_failed| Header | Example | Notes |
|---|---|---|
X-Webhook-Signature |
sha256=a1b2c3... |
HMAC‑SHA256 (see below). |
X-Webhook-Timestamp |
1749600000 |
Unix time the request was signed. |
X-Webhook-Event |
validation.approved |
The event type. |
X-Webhook-Delivery-Id |
4821 |
Unique delivery id (for support/idempotency). |
Content-Type |
application/json |
Always JSON. |
The signature is computed over {timestamp}.{raw_body} using your webhook_secret:
expected = HMAC_SHA256( webhook_secret, X-Webhook-Timestamp + "." + raw_request_body )
provided = X-Webhook-Signature (strip the "sha256=" prefix)
valid = timing_safe_equals(expected, provided)
Also reject requests whose X-Webhook-Timestamp is more than ~5 minutes old to prevent replay.
PHP
function verifyWebhook(string $body, string $sigHeader, string $timestamp, string $secret): bool
{
$provided = str_replace('sha256=', '', $sigHeader);
$expected = hash_hmac('sha256', $timestamp . '.' . $body, $secret);
return hash_equals($expected, $provided);
}
$body = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';
$timestamp = $_SERVER['HTTP_X_WEBHOOK_TIMESTAMP'] ?? '';
if (abs(time() - (int) $timestamp) > 300
|| !verifyWebhook($body, $signature, $timestamp, $webhookSecret)) {
http_response_code(401);
exit('Invalid signature');
}
Node.js
const crypto = require('crypto');
function verifyWebhook(body, sigHeader, timestamp, secret) {
const provided = sigHeader.replace('sha256=', '');
const expected = crypto.createHmac('sha256', secret)
.update(`${timestamp}.${body}`).digest('hex');
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(provided));
}
Python
import hmac, hashlib
def verify_webhook(body: str, sig_header: str, timestamp: str, secret: str) -> bool:
provided = sig_header.replace('sha256=', '')
expected = hmac.new(secret.encode(), f"{timestamp}.{body}".encode(),
hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, provided)
Respond 2xx quickly to acknowledge. Use the raw request body exactly as received — re‑serializing JSON will change the bytes and break the signature.
Instead of sending mobile_number on each request, you can have us call your server at send time to resolve the number. Configure one or both on the authenticator:
lookup_mobile_number_url — called when a validation has no mobile_number. We send you the account_id/customer_id; you return the mobile.lookup_caller_id_url — called when you send caller_phone_number instead. We send you the caller's number; you return the account and mobile.Lookup requests are signed exactly like event webhooks (HMAC‑SHA256 over {timestamp}.{body}), but carry these headers: X-Webhook-Signature, X-Webhook-Timestamp, X-Webhook-Type: validation.lookup, X-Webhook-Request-Id.
We send:
{
"lookup_type": "mobile_number",
"authenticator_id": "1",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-06-11T08:00:00+10:00",
"data": { "account_id": 12345, "customer_id": "CUST-555" }
}
You return (200):
{ "success": true, "data": { "mobile_number": "+61412345678", "customer_id": "CUST-555" } }
We send:
{
"lookup_type": "caller_id",
"authenticator_id": "1",
"request_id": "550e8400-...",
"timestamp": "2026-06-11T08:00:00+10:00",
"data": { "caller_phone_number": "+61298765432", "call_id": "call-abc-123" }
}
You return (200):
{ "success": true, "data": { "account_id": 12345, "mobile_number": "+61412345678", "customer_id": "CUST-555" } }
Not found: return HTTP 404, or 200 with {"success": false, "error": "mobile_not_found"} (or caller_not_found).
lookup_timeout_seconds). Exceeding it fails the validation with lookup_timeout.+61...).404 is treated as "not found" and fails the validation gracefully; other 4xx/5xx also fail it.| Code | HTTP | Description |
|---|---|---|
authenticator_not_found |
404 | Authenticator doesn't exist or is inactive. |
rate_limit_exceeded |
429 | Too many requests (see limit, window). |
insufficient_balance |
402 | Account balance too low. |
validation_not_found |
404 | Validation UUID not found. |
validation_expired |
410 | Validation has expired. |
validation_resolved |
410 | Validation already approved/rejected. |
cooldown_active |
429 | Resend cooldown active (see retry_after). |
lookup_timeout |
504 | Your lookup webhook timed out. |
lookup_failed |
422 | Your lookup webhook returned an error / not found. |
validation_error |
422 | Request validation failed (see errors). |
| Scope | Limit |
|---|---|
| Per account, per minute | 10 validations |
| Per account, per hour | 100 validations |
| Per mobile number, per minute | 3 validations |
| Per mobile number, per hour | 10 validations |
Each validation costs $0.10 AUD, deducted from your account balance when the validation is created. SMS charges are billed separately through the standard SMS billing system. If your balance is insufficient, the validation resolves as insufficient_balance and no SMS is sent.