# SMS Consent

Source: https://docs.autessa.com/docs/api/poweruser/sms-consent

> Poweruser endpoints for recording and checking SMS messaging consent for A2P 10DLC compliance.

# SMS Consent

Record proof that a phone number's owner agreed to receive SMS from your company, check a number's consent status before texting it, and upload supporting evidence — the compliance layer behind agent-sent SMS.

> All paths on this page are relative to `https://api.autessa.com/autessa_poweruser/sms-consent`. Every request is a POST with a JSON body. See the [Poweruser API overview](/docs/api/poweruser.md) for authentication and conventions.

---

## The consent model

US carriers require A2P 10DLC senders to hold documented consent for every
number they message. In Autessa that works as follows:

1. **You record consent** with [`/sms-consent`](#create-a-consent-record) — the phone
   number, how consent was captured (`consentMethod`), a description, and
   optionally an evidence file (a screenshot of the web form, a signed
   document, a call recording) uploaded via
   [`/generate-upload-link`](#generate-an-evidence-upload-link).
2. **Autessa reviews it.** New records start unapproved; the Autessa
   compliance team approves them, or rejects them with `rejectionFeedback`
   explaining what to fix before resubmitting.
3. **You check before sending** with [`/search`](#search-consent-by-phone-number). A number
   is safe to message when `hasConsent` and `isApproved` are `true` and
   `isOptedOut` is `false`.
4. **Recipients can opt out** (for example by replying STOP). Opt-out is
   tracked per number and overrides any approval.

Everything is scoped to the poweruser key's linked company — the company ID
is derived from the key and cannot be overridden in a request, so you can
only ever create or read consent records for your own company.

Consent methods: `WEB_FORM` (submitted via a web form), `USER_INITIATED`
(the user texted first — implicit consent), `VERBAL` (recorded verbal
consent), `WRITTEN` (signed consent form), `OTHER`.

---

## Create a consent record

**POST** `/sms-consent`

Records consent for a phone number. Note the path: this is the **base**
resource path with no suffix. The record starts unapproved and enters the
compliance review queue; poll [`/search`](#search-consent-by-phone-number) to see when it is
approved.

### Request parameters

- `phoneNumber` (string, required) — The phone number consent applies to, in E.164 format (for example `+12065550142`).
- `consentMethod` (string, required) — How consent was captured: `WEB_FORM`, `USER_INITIATED`, `VERBAL`, `WRITTEN`, or `OTHER`.
- `consentDescription` (string) — What the person agreed to and how — shown to the reviewer.
- `evidenceS3Uri` (string) — Key of an uploaded evidence file: the `s3Uri` returned by [`/generate-upload-link`](#generate-an-evidence-upload-link). The older `s3://` form is still accepted.
- `termsOfServiceUrl` (string) — URL of the terms of service the person accepted.
- `privacyPolicyUrl` (string) — URL of the privacy policy the person accepted.

### Response

- `consentId` (string) — The new consent record.
- `status` (string) — Human-readable status of the record.
- `isApproved` (boolean) — Whether the record is approved. Always `false` immediately after creation — approval happens during compliance review.
- `errors` (array<string>) — Error messages, if any occurred.

**cURL:**

```bash
curl https://api.autessa.com/autessa_poweruser/sms-consent \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+12065550142",
    "consentMethod": "WEB_FORM",
    "consentDescription": "Opted in to order updates via the checkout form.",
    "evidenceS3Uri": "sms-consent/1024/8f3a2b7c.png",
    "termsOfServiceUrl": "https://acme.com/terms",
    "privacyPolicyUrl": "https://acme.com/privacy"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/autessa_poweruser/sms-consent',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.POWERUSER_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      phoneNumber: '+12065550142',
      consentMethod: 'WEB_FORM',
      consentDescription: 'Opted in to order updates via the checkout form.',
      termsOfServiceUrl: 'https://acme.com/terms',
      privacyPolicyUrl: 'https://acme.com/privacy'
    })
  }
);

const { consentId, isApproved } = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/autessa_poweruser/sms-consent',
    headers={'Authorization': os.environ['POWERUSER_KEY']},
    json={
        'phoneNumber': '+12065550142',
        'consentMethod': 'WEB_FORM',
        'consentDescription': 'Opted in to order updates via the checkout form.',
        'termsOfServiceUrl': 'https://acme.com/terms',
        'privacyPolicyUrl': 'https://acme.com/privacy'
    }
)

consent = response.json()
```

```json title="Response"
{
  "consentId": "sC7wJ2fN9q",
  "status": "PENDING_APPROVAL",
  "isApproved": false,
  "errors": []
}
```

---

## Search consent by phone number

**POST** `/sms-consent/search`

Looks up the consent status of a phone number within your company. Call this
before sending SMS: the number is messageable only when `hasConsent` and
`isApproved` are `true` and `isOptedOut` is `false`.

### Request parameters

- `phoneNumber` (string, required) — The phone number to look up, in E.164 format.

### Response

- `hasConsent` (boolean) — Whether a consent record exists for this number.
- `isApproved` (boolean) — Whether the record passed compliance review.
- `isOptedOut` (boolean) — Whether the recipient has since opted out. Opt-out overrides approval.
- `consentMethod` (string) — How consent was captured: `WEB_FORM`, `USER_INITIATED`, `VERBAL`, `WRITTEN`, or `OTHER`.
- `consentedAt` (string) — ISO-8601 timestamp of when consent was recorded.
- `rejectionFeedback` (string) — Reviewer feedback when the record was rejected — explains what to change before resubmitting.
- `errors` (array<string>) — Error messages, if any occurred.

**cURL:**

```bash
curl https://api.autessa.com/autessa_poweruser/sms-consent/search \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phoneNumber": "+12065550142" }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/autessa_poweruser/sms-consent/search',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.POWERUSER_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ phoneNumber: '+12065550142' })
  }
);

const { hasConsent, isApproved, isOptedOut } = await response.json();
const canText = hasConsent && isApproved && !isOptedOut;
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/autessa_poweruser/sms-consent/search',
    headers={'Authorization': os.environ['POWERUSER_KEY']},
    json={'phoneNumber': '+12065550142'}
)

data = response.json()
can_text = data['hasConsent'] and data['isApproved'] and not data['isOptedOut']
```

```json title="Response"
{
  "hasConsent": true,
  "isApproved": true,
  "isOptedOut": false,
  "consentMethod": "WEB_FORM",
  "consentedAt": "2026-06-15T10:04:31",
  "rejectionFeedback": null,
  "errors": []
}
```

---

## Generate an evidence upload link

**POST** `/sms-consent/generate-upload-link`

Returns a pre-signed S3 URL for uploading a consent evidence file (a form
screenshot, a signed document, and so on). Upload the file with an HTTP
`PUT` to `uploadUrl` using the returned `mimeType` as `Content-Type`, then
pass `s3Uri` as `evidenceS3Uri` when [creating the record](#create-a-consent-record).
The upload location is scoped to your company.

### Request parameters

- `fileExtension` (string) — `"png"`, `"jpg"`, `"jpeg"`, or `"pdf"`.

### Response

- `uploadUrl` (string) — Pre-signed URL; `PUT` the file bytes here.
- `s3Uri` (string) — Key of the uploaded file. Pass it as `evidenceS3Uri`.
- `mimeType` (string) — MIME type to send as `Content-Type` on the upload.
- `expiresInSeconds` (integer) — How long the upload URL stays valid.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/sms-consent/generate-upload-link \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fileExtension": "png" }'

# Then upload the evidence file:
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary '@consent-form-screenshot.png'
```

```json title="Response"
{
  "uploadUrl": "https://s3.amazonaws.com/autessa-files/...",
  "s3Uri": "sms-consent/1024/8f3a2b7c.png",
  "mimeType": "image/png",
  "expiresInSeconds": 3600,
  "errors": []
}
```

---

## Errors

| Status | When |
|--------|------|
| `200` | Success — check `errors` for validation messages (missing or malformed `phoneNumber`, missing `consentMethod`). |
| `401` | Invalid or missing poweruser key. |
| `403` | Scoped key without the endpoint in its allow-list. |
| `408` | Server-side error; `errors` contains the message. |

---

## Related

- [Poweruser API overview](/docs/api/poweruser.md)
- [Phone Numbers (Poweruser API)](/docs/api/poweruser/phone-numbers.md)
- [SMS consent guide](/docs/guide/agentic/sms-consent.md)
- [Phone numbers guide](/docs/guide/agentic/phone-numbers.md)

