A2P 10DLC pre-scan API
Add A2P 10DLC campaign pre-scanning to your messaging workflows: validate descriptions, sample messages, opt-in flows, and policy URLs over JSON — one campaign per call, scripted across your pipeline — before they're registered through Twilio, Plivo, Vonage, or any other provider.
The API checks campaign readiness; registration itself always happens with your provider. New to the review process? Start with what A2P verification means, or try a one-off scan in the free scanner.
Machine-readable specs are published: /openapi.json (OpenAPI 3.1) and /llms-full.txt (full field reference for AI agents). Building an agent or coding harness? See the agent guide.
Wiring the API into a provider-specific flow? See what each provider's registration reviews before you script the submission: Twilio, Plivo, Vonage, or the full provider list. The API checks readiness; registration stays with your provider.
For agencies, consultants & platform teams
If you register A2P 10DLC campaigns on behalf of clients — or your product onboards businesses that do — use the API to pre-scan every campaign before it reaches Twilio / TCR. Common patterns: gate submission on a GREEN report, surface per-field findings inline in your onboarding form, or store the scan output for client audit trails.
Create a self-serve API key from your developer dashboard and pass it as a bearer token for headless / API access. Scans run against your account and spend your credits. Anonymous/basic validation still works without a key for low-volume checks.
Create an API keyAuthentication
Bearer auth is optional for the agent endpoint. Without a token, scans run under the anonymous/basic limits. Create a self-serve key from your developer dashboard and send it as a bearer token to run full scans against your account's credits. The full key is shown once at creation — we store only a hash, so save it then.
Authorization: Bearer a2p_live_your_api_key_here
Endpoints
/api/agent/validateStable JSON endpoint for AI agents and coding harnesses. Body: { tier?, campaign, campaignName?, idempotencyKey? }. Bearer token optional; defaults to the anonymous basic tier. Documented in /openapi.json.
/api/v1/scan · /api/v1/scan/quickThese are the underlying worker routes used by the hosted app. Agents should prefer /api/agent/validate, which keeps the payload stable and same-origin.
Request Body
{
"useCaseType": "MARKETING", // required
"campaignDescription": "...", // required
"sampleMessages": ["msg1", "msg2"], // required, 2-5 items
"messageFlow": "...", // required
"businessName": "Acme Inc", // optional
"privacyPolicyUrl": "https://...", // optional
"websiteUrl": "https://...", // optional
"termsOfServiceUrl": "https://...", // optional
"optInKeywords": ["START"], // optional
"optOutKeywords": ["STOP"], // optional
"helpKeywords": ["HELP"], // optional
"optInMessage": "...", // optional
"optOutMessage": "...", // optional
"helpMessage": "...", // optional
"embeddedLinks": true, // optional
"embeddedPhoneNumbers": false, // optional
"ageGatedContent": false, // optional
"directLending": false, // optional
"numberPool": false // optional
}Example
curl -X POST https://www.a2pcheck.com/api/agent/validate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer a2p_live_your_api_key_here" \
-d '{
"tier": "full",
"campaign": {
"useCaseType": "MARKETING",
"campaignDescription": "Weekly promotional offers...",
"sampleMessages": [
"Acme: 20% off this week! Shop at acme.com/sale. Reply STOP to opt out.",
"Acme: New arrivals just dropped! Browse at acme.com/new. Msg&data rates apply."
],
"messageFlow": "Customers opt in via checkout checkbox at acme.com",
"optOutKeywords": ["STOP"],
"helpKeywords": ["HELP"]
}
}'Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Malformed body / invalid tier / missing campaign |
| 401 | INVALID_API_KEY | API key is missing, unknown, or revoked |
| 401 | AUTH_REQUIRED | This scan tier needs a signed-in account or key |
| 402 | INSUFFICIENT_CREDITS | Account needs more scan credits |
| 429 | ANON_SCAN_LIMIT | Anonymous per-IP daily limit hit |
| 5xx | SCAN_FAILED | Upstream scan failure (retry later) |
Headless API access
Self-serve API keys are live. Create one from your developer dashboard and send it as a bearer token. The anonymous basic endpoint still works without a key for low-volume agent checks.
Create an API key