> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neariq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS Compliance

> Register NearIQ phone numbers for carrier SMS compliance before sending texts.

Phone Compliance covers the required carrier registration flow for NearIQ-owned SMS numbers. The customer flow is:

1. Provision a business phone number.
2. Register the number or business for SMS compliance.
3. Wait for carrier approval.
4. Send SMS only after the number is approved.

In API terms: provision the number, register compliance, wait for approval, then send.

NearIQ keeps voice calling separate. Voice can continue while SMS compliance is pending, but outbound SMS returns `sms_compliance_pending` until the relevant toll-free verification or 10DLC campaign is approved.

## GET /api/businesses/me/phone-compliance

Returns compliance records for the active business, including status, rejection details, submitted dates, and the matching phone number.

```bash theme={null}
curl "https://app.neariq.io/api/businesses/me/phone-compliance" \
  -H "Cookie: neariq-session=..."
```

## POST /api/businesses/me/phone-compliance

Submits compliance for the active business phone number. Toll-free numbers use carrier toll-free verification. Local US numbers use A2P 10DLC brand registration and campaign registration through the configured Messaging Service.

```bash theme={null}
curl -X POST "https://app.neariq.io/api/businesses/me/phone-compliance" \
  -H "Content-Type: application/json" \
  -H "Cookie: neariq-session=..." \
  -d '{
    "phoneNumberId": "00000000-0000-4000-8000-000000000000",
    "businessName": "Aster Grove Fitness",
    "businessWebsite": "https://aster.example",
    "businessType": "PRIVATE_PROFIT",
    "businessStreetAddress": "100 Market St",
    "businessCity": "Austin",
    "businessStateProvinceRegion": "TX",
    "businessPostalCode": "78701",
    "businessCountry": "US",
    "businessContactFirstName": "Ari",
    "businessContactLastName": "Rivera",
    "businessContactEmail": "owner@example.com",
    "businessContactPhone": "+15125550123",
    "useCaseCategories": ["CUSTOMER_CARE"],
    "useCaseSummary": "Customer care, review requests, reminders, and local business updates.",
    "productionMessageSample": "Hi, this is Aster Grove Fitness. Reply STOP to opt out.",
    "optInType": "WEB_FORM",
    "messageVolume": "100",
    "messageSamples": ["Hi, this is Aster Grove Fitness. Reply STOP to opt out."]
  }'
```

## PATCH /api/businesses/me/phone-compliance/{id}

Updates and resubmits a rejected or draft registration. The body accepts the same fields as `POST`, but all fields are optional.

## POST /api/compliance/status-callback

Signed communications-provider callback endpoint for compliance status changes. It updates verification and linked phone-number records. If callbacks are missed, NearIQ checks pending registrations on a regular schedule.

When the status changes, NearIQ sends branded transactional email to the account notification email, profile email, or registration contact email:

* Approved: "Your SMS number is ready!"
* Rejected/action required/expired: "SMS verification needs attention"
* Pending after three days: "Your SMS number is being reviewed"
* Pending after seven days: "We've escalated your verification - no action needed from you"

Customer email bodies stay provider-neutral. Daily compliance monitoring records pending reminders and escalations, then notifies support for stuck reviews when that internal support intake is configured.

## SMS Send Gate

All outbound SMS sends check the linked phone number before contacting the communications provider. If approval is not complete, the API returns:

```json theme={null}
{
  "error": "sms_compliance_pending",
  "message": "SMS sending requires compliance approval. Current status: pending_review",
  "complianceStatus": "pending_review"
}
```

## Admin

Admins can audit all registrations:

```bash theme={null}
curl "https://app.neariq.io/api/admin/phone-compliance?status=pending_review" \
  -H "Cookie: neariq-session=..."
```
