{"openapi":"3.1.0","info":{"title":"A2PCheck API","version":"0.1.0","summary":"Pre-submission readiness checks for A2P 10DLC campaigns.","description":"Independent A2P 10DLC campaign-readiness checker. Validate a campaign draft against common Twilio / TCR / carrier rejection patterns before submitting it through a provider. A2PCheck does not submit campaigns and cannot guarantee approval."},"servers":[{"url":"https://www.a2pcheck.com"}],"paths":{"/api/agent/validate":{"post":{"operationId":"validateCampaign","summary":"Validate an A2P 10DLC campaign (stable agent surface)","description":"JSON-only. Returns a readiness verdict and per-field findings. Bearer token optional; without one, the anonymous basic tier applies (rate-limited per IP). Use a developer API key from /dashboard/api-keys for full/headless scans that spend account credits.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["campaign"],"properties":{"tier":{"type":"string","enum":["basic","full"],"default":"basic"},"campaign":{"$ref":"#/components/schemas/ScanRequest"},"campaignName":{"type":"string","maxLength":200},"idempotencyKey":{"type":"string","maxLength":128}}}}}},"responses":{"200":{"description":"Scan result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}},"/api/scan":{"post":{"operationId":"scanCampaign","summary":"Validate a campaign (browser/app surface)","description":"Used by the web UI. Same engine as /api/agent/validate but with a richer envelope. Prefer /api/agent/validate for programmatic agent use.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tier","request"],"properties":{"tier":{"type":"string","enum":["basic","full"]},"request":{"$ref":"#/components/schemas/ScanRequest"},"campaignName":{"type":"string"},"idempotencyKey":{"type":"string"}}}}}},"responses":{"200":{"description":"Scan result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"Error":{"description":"Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ScanRequest":{"type":"object","required":["useCaseType","campaignDescription","sampleMessages","messageFlow"],"additionalProperties":false,"properties":{"useCaseType":{"type":"string","description":"Provider use-case label, e.g. MARKETING, MIXED, CUSTOMER_CARE, 2FA."},"campaignDescription":{"type":"string"},"sampleMessages":{"type":"array","items":{"type":"string"},"minItems":1,"description":"2–5 real example messages."},"messageFlow":{"type":"string","description":"How recipients opt in (consent path)."},"businessName":{"type":"string"},"privacyPolicyUrl":{"type":"string","format":"uri"},"websiteUrl":{"type":"string","format":"uri"},"termsOfServiceUrl":{"type":"string","format":"uri"},"optInKeywords":{"type":"array","items":{"type":"string"}},"optOutKeywords":{"type":"array","items":{"type":"string"}},"helpKeywords":{"type":"array","items":{"type":"string"}},"optInMessage":{"type":"string"},"optOutMessage":{"type":"string"},"helpMessage":{"type":"string"},"embeddedLinks":{"type":"boolean"},"embeddedPhoneNumbers":{"type":"boolean"},"ageGatedContent":{"type":"boolean"},"directLending":{"type":"boolean"},"numberPool":{"type":"boolean"}}},"FieldResult":{"type":"object","properties":{"field":{"type":"string"},"displayName":{"type":"string"},"tier":{"type":"string","enum":["RED","YELLOW","GREEN"]},"rationale":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["critical","warning","info"]},"message":{"type":"string"},"twilioErrorCode":{"type":["string","null"]}}}},"suggestions":{"type":"array","items":{"type":"object","properties":{"issue":{"type":"string"},"fix":{"type":"string"},"example":{"type":"string"}}}}}},"ScanResponse":{"type":"object","properties":{"scanId":{"type":"string"},"timestamp":{"type":"string"},"rulesVersion":{"type":"string"},"overallTier":{"type":"string","enum":["RED","YELLOW","GREEN"]},"overallSummary":{"type":"string"},"criticalIssues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["critical"]},"message":{"type":"string"},"twilioErrorCode":{"type":["string","null"]}}}},"warnings":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["warning"]},"message":{"type":"string"}}}},"fieldResults":{"type":"array","items":{"$ref":"#/components/schemas/FieldResult"}},"metadata":{"type":"object","properties":{"scanDurationMs":{"type":"number"},"fieldsAnalyzed":{"type":"number"},"aiModel":{"type":"string"},"urlsCrawled":{"type":"array","items":{"type":"string"}},"quickScan":{"type":"boolean"},"partial":{"type":"boolean"}}}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","required":["code","message","traceId"],"properties":{"code":{"type":"string","description":"BAD_REQUEST | AUTH_REQUIRED | INVALID_API_KEY | INSUFFICIENT_CREDITS | ANON_SCAN_LIMIT | SCAN_FAILED"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"issue":{"type":"string"}}}},"retryAfterSeconds":{"type":"number"},"traceId":{"type":"string"}}}}}}}}