Verify a PIN
curl --request POST \
--url https://api.onexaura.com/v1/pins/{pinId}/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pin": "123456"
}
'import requests
url = "https://api.onexaura.com/v1/pins/{pinId}/verify"
payload = { "pin": "123456" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({pin: '123456'})
};
fetch('https://api.onexaura.com/v1/pins/{pinId}/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://api.onexaura.com/v1/pins/{pinId}/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([
'pin' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.onexaura.com/v1/pins/{pinId}/verify"
payload := strings.NewReader("{\n \"pin\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.onexaura.com/v1/pins/{pinId}/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onexaura.com/v1/pins/{pinId}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"pinId": "pin_x9k2m1qz",
"status": "VERIFIED",
"attemptsRemaining": 2
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}Verify
Verify a PIN
Check the code the user typed against the stored hash.
POST
/
v1
/
pins
/
{pinId}
/
verify
Verify a PIN
curl --request POST \
--url https://api.onexaura.com/v1/pins/{pinId}/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pin": "123456"
}
'import requests
url = "https://api.onexaura.com/v1/pins/{pinId}/verify"
payload = { "pin": "123456" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({pin: '123456'})
};
fetch('https://api.onexaura.com/v1/pins/{pinId}/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://api.onexaura.com/v1/pins/{pinId}/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([
'pin' => '123456'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.onexaura.com/v1/pins/{pinId}/verify"
payload := strings.NewReader("{\n \"pin\": \"123456\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.onexaura.com/v1/pins/{pinId}/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"123456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onexaura.com/v1/pins/{pinId}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": \"123456\"\n}"
response = http.request(request)
puts response.read_body{
"pinId": "pin_x9k2m1qz",
"status": "VERIFIED",
"attemptsRemaining": 2
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}{
"error": {
"code": "pin_expired",
"message": "<string>",
"requestId": "req_9f3a2c",
"details": {}
}
}Submit the code exactly as the user typed it. OneXtel compares it against the stored hash in
constant time, so the comparison itself leaks nothing about how close a wrong guess was.
Reading the outcome
A200 is the only success. Everything else is a distinct error code, and they mean different
things to your UI:
| Code | HTTP | What to show the user |
|---|---|---|
| — | 200 | Verified — continue the flow |
pin_incorrect | 422 | ”That code isn’t right” — offer a retry |
pin_expired | 410 | ”That code has expired” — offer a resend |
pin_blocked | 409 | ”Too many attempts” — offer a resend |
pin_already_verified | 409 | Already used — treat as done, or start a new send |
Expired and incorrect are deliberately separate codes. Collapsing them into one “invalid code”
message makes a user who waited too long retype a code that can never work.
Attempts
Both the200 response and a pin_incorrect error carry attemptsRemaining. Use it to warn
before the PIN is spent — at zero, the next wrong guess returns pin_blocked and the PIN is
dead. The allowance is set per template as pinAttempts and is reset by every
resend.
Verify calls are rate limited per template via verifyPinLimit; exceeding it returns
rate_limited (429).Authorizations
An API key from the OneXtel portal, Developers → API Keys, sent as Authorization: Bearer <key>.
Path Parameters
Example:
"pin_x9k2m1qz"
Body
application/json
The code as the end user typed it.
Example:
"123456"
Was this page helpful?

