429 envelope apply, exactly as on the rest of the v1 API.
Lifecycle
POST /api/v1/spam/numbers— add a number. Verification is auto-initiated (a call or SMS to the number).- The recipient reads back the code; you submit it to
POST /api/v1/spam/numbers/{id}/verify. Missed it?…/verify/resend. - Once verified, OptimalDial re-tests the number daily across each carrier.
- You read results via
GET /api/v1/spam/numbers/…/{id}(latest per-carrier status),…/{id}/history(recent runs), and…/{id}/screenshot(the captured image) — or subscribe to thespam.detectedandnumber.verifiedwebhook events.
The MonitoredNumber object
The CarrierStatus object
Verification (SMS or call)
Verification is required for the monitoring service to function — OptimalDial must verify the number before it can place test calls on its behalf. It is not an ownership or security gate; it’s a carrier prerequisite for the test traffic.- The add endpoint auto-initiates verification. By default it places a call (
verification_method: "call"); pass"sms"to receive a text instead. - The recipient reads back (or copies) the code and you submit it to
…/verify. - SMS isn’t deliverable to landlines. Requesting
"sms"for a non-SMS-capable number returns400— fall back tocall. - Use
…/verify/resendto re-send the code, optionally switching method (e.g. fromsmstocall).
verified flag flips to true once a correct code is submitted, and the number.verified webhook fires.
Add a monitored number
201 with the new MonitoredNumber and a verification block describing how the code was dispatched.
Request body
- cURL
- Node.js
- Python
Response
201 Created:
Errors
Submit a verification code
verified and daily monitoring begins.
Request body
- cURL
- Node.js
- Python
Response
Errors
Resend a verification code
call when sms couldn’t be delivered.
Request body (optional)
Response
Errors
List monitored numbers
Query parameters
Response
spam_monitoring_limit is your effective limit: the numbers included with your plan plus
any additional numbers purchased at $5/month each. It is null when your plan (or an admin
account) has no cap.
Adding a number beyond this limit returns 403. Numbers already monitored beyond the limit
(for example after a downgrade) are kept but not tested — the oldest numbers up to the limit
are the ones that receive daily tests. Owners can raise the limit from Billing → Spam
Monitoring Add-On in the dashboard.
Errors
Retrieve a monitored number
MonitoredNumber with its latest per-carrier status.
Errors
List recent test runs
Response
The TestRunHistoryItem object
Errors
Get the latest screenshot
image/jpeg — not JSON. Pass carrier to select a specific carrier’s screenshot; omit it for the most recent across carriers.
Query parameters
Content-Type: image/jpeg. Write it straight to a file (as above) rather than parsing it as JSON. Screenshots captured before the JPEG rollout may still return image/png for up to 7 days (the screenshot retention window) — check the Content-Type header if the distinction matters to you.
Errors
Stop monitoring a number
Response
Errors
Webhook alerts
Instead of polling, subscribe to spam-monitoring events on your existing webhook endpoints. They use the same HMAC signing, headers, and retry behaviour as every other event — see the Receiving webhooks guide. Register interest by including the event types when you create or update an endpoint:
See the webhooks guide for the full payload bodies. In short,
spam.detected carries the flagging carrier, label, SIP response, and a screenshot_available flag; number.verified carries the number’s id, phone, carrier, and verification time.