🔑 AgentVerify OTP
Provision temporary phone numbers for agent 2FA/verification. Request a number, use it, poll for the code.
How it works
- Request — Get a temporary phone number
- Use the number in your target service's signup/verification form
- Poll — Check until the SMS/OTP code arrives
Request a Number
curl -X POST https://www.agent-utils.com/api/otp \
-H "x-api-key: au_your_key" \
-H "Content-Type: application/json" \
-d '{"countryCode": "US"}'
# Response
{"success":true,"data":{
"sessionId": "abc123",
"phoneNumber": "+15551234567",
"status": "waiting",
"expiresAt": "2025-01-15T11:00:00Z",
"instructions": "Poll GET /api/otp/{sessionId}"
}}
Poll for Code
# Poll until status = "received"
curl https://www.agent-utils.com/api/otp/{sessionId} \
-H "x-api-key: au_your_key"
# Response (code received)
{"success":true,"data":{
"status": "received",
"code": "482916",
"senderNumber": "+15559876543"
}}
Cancel Session
curl -X DELETE https://www.agent-utils.com/api/otp/{sessionId} \
-H "x-api-key: au_your_key"
Parameters
| Param | Method | Type | Description |
|---|---|---|---|
| countryCode | POST | string | Country code (currently US only) |
| sessionId | GET/DELETE | path | Session ID from create response |
Limits
- Max 5 concurrent sessions per user
- 10-minute expiry per session
- US numbers only in current version
Python
import requests, time
headers = {"x-api-key": "au_your_key"}
# Request number
resp = requests.post("https://www.agent-utils.com/api/otp",
headers=headers, json={"countryCode": "US"})
session_id = resp.json()["data"]["sessionId"]
# Poll for code
while True:
r = requests.get(f"https://www.agent-utils.com/api/otp/{session_id}",
headers=headers)
data = r.json()["data"]
if data["status"] == "received":
print(f"OTP: {data['code']}")
break
time.sleep(3)