# Get consent to text

Choose how consent to your texts is held, record that a phone agreed, and see every consent and withdrawal per phone.

Carriers require permission from recipients to send texts. Provenance keeps one consent record per phone for your company: who agreed, how, when and to which wording, and when it was withdrawn.

**Before you begin:** you need an account key or a console session with the settings role. Consent records are on the Pro plan and above; every plan can choose how consent is held, so the choice is ready when you move to a paid plan.

## 1. Choose how consent is held

You choose one of two modes in **Settings › Texts › Consent**, or with [`PUT /v1/account/text_consent`](https://provenanceauth.com/docs/api/account.md#put-v1-account-text-consent). There is no default.

| Mode | `mode` | Who asks the person |
| --- | --- | --- |
| **Provenance asks** | `provenance` | Provenance, in its own wording, before the request opens |
| **We have it** | `company` | You, your own way. You say how people agree |

Under **We have it**, `everyone` is your statement that everyone you text agreed, with how they agreed. Send `null` instead to name each person you text.

**curl**

```bash norun
curl -X PUT $PROVENANCE_API/v1/account/text_consent \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "company", "everyone": { "method": "sign_up_form" } }'
```

**Node**

```ts
await prov.account.setTextConsentSettings({ mode: "company", everyone: { method: "sign_up_form" } });
```

**Python**

```python
prov.account.set_text_consent_settings(mode="company", everyone={"method": "sign_up_form"})
```

The four ways people agree are `sign_up_form` (on your sign-up form), `in_app` (in your app), `in_person` (in person or on paper) and `customer_list` (from your customer list).

A new method starts a new statement. `everyone: null` or a change to `provenance` ends it, and the ended statement is kept with its dates. Records you already hold stay in every case.

## 2. Under Provenance asks: the step before the request

Under **Provenance asks**, the person is asked on a screen of its own before your request opens: the capture page, the cart approval page and the approver invite page, the capture and checkout approval [embeds](https://provenanceauth.com/docs/embeds.md) in your own product, the React Native `CaptureFlow` and the Swift and Kotlin `TextConsentStep` in your app, and the Provenance app. It shows when all of these hold:

- you're on the Pro plan or above;
- the request carries a phone you gave, and its `channels` holds `text`;
- that phone has no consent for your company and didn't reply STOP to your number.

The step shows your company's name, the phone (**•••• 0132**), Provenance's fixed wording with small **Terms** · **Privacy** links, and **Not now** and **Text me**. Either button goes on to your request. The wording is the same everywhere:

> **Note: The wording**
>
> Text me about requests from Pellowmarsh Clinics. Msg frequency varies. Msg & data rates may apply. Reply STOP to opt out.

The links are your terms and privacy pages from your [sending number's details](https://provenanceauth.com/docs/messaging/sending-numbers.md). For each one you haven't given, the link is Provenance's own page, so both always show.

| `links` on the step's read | Whose pages |
| --- | --- |
| `company` | Both are yours |
| `provenance` | Both are Provenance's: you gave neither |
| `mixed` | One of each |

| Where | What the person sees | What it records |
| --- | --- | --- |
| The request's email | **Also text me at •••• 0132** under the button, opening the step | Nothing: only the step's button records |
| The request's page | The step, then the page | **Text me**: a record with `source: "step"` |
| The Provenance app | A notification, "Pellowmarsh Clinics wants to text you", with **Allow** and **Not now**, and the same step before the request | **Allow**: a record with `source: "step"` |
| `<provenance-capture capture-request>` on your page | The step as the widget's first screen, then the capture | **Text me**: a record with `source: "step"`, through the widget's own embed token |
| `<provenance-checkout-approval>` on your page | The step as the widget's first screen, then the approval | **Text me**: a record with `source: "step"`, through the approval's request token |
| `ProvenanceCaptureFlow` in your React Native app | The step as the flow's first screen, then the intro | **Text me**: a record with `source: "step"`, through the capture token |
| `TextConsentStep` in your Swift or Kotlin app | The step as a screen before your own request screen | **Text me**: a record with `source: "step"`, through the request's capture embed token or its capture link's token |

The widgets and `CaptureFlow` show the step on their own: there is nothing to add to your code. In a Swift or Kotlin app, show `TextConsentStep` before your request screen and go on when it finishes; see [Text consent for Swift](https://provenanceauth.com/docs/messaging/text-consent/swift.md) and [for Kotlin](https://provenanceauth.com/docs/messaging/text-consent/kotlin.md). Where the step ran is kept for evidence only, never on the record you read:

| Surface | Where |
| --- | --- |
| `web` | The request's page |
| `app` | The Provenance app |
| `embed` | A capture or checkout approval widget |
| `react_native` | `CaptureFlow` |
| `swift` | `TextConsentStep` in SwiftUI |
| `kotlin` | `TextConsentStep` in Jetpack Compose |

**Not now** stores nothing, and your next request asks again. A consent counts for all your request texts, not one request.

Right after a consent, one confirmation text goes from your own number: "Pellowmarsh Clinics: you'll get texts about your requests. Msg frequency varies. Msg & data rates may apply. Reply HELP for help, STOP to opt out." It's metered as one of the request's texts. Before your number is approved the record reads `confirmation: "skipped_no_number"` and no text goes, then or later.

Every request email that carries a phone has **Manage texts** in its footer, and so do the request pages. It opens a page with your company's consent for that phone and **Withdraw**, with no account needed. People with the app also see every company they allowed in **More › Texts**.

## 3. Under We have it: record that a phone agreed

Under **We have it**, record one phone with [`POST /v1/account/text_consents`](https://provenanceauth.com/docs/api/account.md#post-v1-account-text-consents), or add `text_consent` to the `contact` of a capture request, a cart approval or an assessment.

**curl**

```bash norun
curl -X POST $PROVENANCE_API/v1/attest/capture_requests \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "case_id": "ONB-14201",
    "session_type": "id",
    "contact": {
      "phone": "+14155550132",
      "text_consent": { "method": "sign_up_form", "obtained_at": "2026-11-02T16:05:00Z", "evidence_url": "https://pellowmarsh.example/intake" }
    }
  }'
```

**Node**

```ts
await prov.account.createTextConsent({ phone: "+14155550132", method: "sign_up_form", obtainedAt: "2026-11-02T16:05:00Z" });
```

| Field | Rule |
| --- | --- |
| `method` | Required. One of the four ways people agree |
| `obtained_at` | Required. When the person agreed; not in the future |
| `evidence_url` | Optional. An `https` link to how they agreed, at most 2,048 characters. Stored, never fetched |

A phone that already has an active record keeps it. A statement outside `company` is `409 text_consent_mode_mismatch`, and a request that carried it is not created.

## 4. Import a CSV

Under **We have it**, add many phones at once from a file: **Settings › Texts › Import › Upload CSV**, or [`POST /v1/account/text_consent_imports`](https://provenanceauth.com/docs/api/account.md#post-v1-account-text-consent-imports) with the file as the body (`Content-Type: text/csv`) or as the form field `file`.

```csv
phone,method,obtained_at,evidence_url
+14155550132,sign_up_form,2026-11-02,https://pellowmarsh.example/intake
(415) 555-0187,customer_list,2026-11-01T09:30:00Z,
```

| Column | Rule |
| --- | --- |
| `phone` | Required. E.164 (`+14155550132`), or ten US digits, read as +1. Spaces, dashes, dots and brackets are ignored |
| `method` | Required. One of the four ways people agree |
| `obtained_at` | Required. A date (`2026-11-02`) or a date and time; not in the future |
| `evidence_url` | Optional. An `https` link, at most 2,048 characters. Stored, never fetched |

The file needs a header row with those column names, is UTF-8 (in Excel, save as **CSV UTF-8**), and holds up to 50,000 rows and 5 MB. A file that breaks any of these adds nothing: `400 parameter_invalid` with `param: "file"` and the reason.

**curl**

```bash norun
curl -X POST "$PROVENANCE_API/v1/account/text_consent_imports?file_name=consents.csv" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: text/csv" \
  --data-binary @consents.csv
```

**Node**

```ts
import { readFile } from "node:fs/promises";

const started = await prov.account.importTextConsents(await readFile("consents.csv"), { fileName: "consents.csv" });
const done = await prov.account.getTextConsentImport(started.id);
```

**Python**

```python
with open("consents.csv", "rb") as f:
    started = prov.account.import_text_consents(f.read(), file_name="consents.csv")
done = prov.account.get_text_consent_import(started["id"])
```

The upload is answered at once with the import, `status: "processing"`, and its rows are written in the background. Read it with [`GET /v1/account/text_consent_imports/{id}`](https://provenanceauth.com/docs/api/account.md#get-v1-account-text-consent-imports-id) until it is `completed`, or wait for the `text_consent_import.completed` [webhook](https://provenanceauth.com/docs/integrate/webhooks.md). Each row is counted once:

| A row | Counted |
| --- | --- |
| Valid, the phone has no active record | `added`: a record with `source: "import"` and the import's id |
| Valid, the phone already has an active record | `already_agreed`: that record is left as it is |
| Valid, the phone replied STOP to your number | `stopped`: added, and the phone stays stopped |
| Not valid, or the same phone as an earlier row | `not_added`, listed in `errors` with its line and reason |

A bad row never stops the rest. Its line counts the header as line 1, as a spreadsheet does.

| Reason | The row |
| --- | --- |
| `phone_invalid` | The phone is not a valid number |
| `method_invalid` | The method is not one of the four |
| `obtained_at_invalid` | The date is missing, not a date, or in the future |
| `evidence_url_invalid` | The link is not `https`, or is over 2,048 characters |
| `duplicate` | The same phone is on an earlier row |

The import lists the first 1,000; [`GET /v1/account/text_consent_imports/{id}/errors`](https://provenanceauth.com/docs/api/account.md#get-v1-account-text-consent-imports-id-errors) downloads all of them as a CSV. The rows themselves are not kept, so find each line in your own file.

Sending the same file again within a day answers the earlier import (`replayed: true`) and writes nothing. A changed file is a new import, and phones already agreed are left alone, so sending a list again is safe. The file is never stored: only its name and the counts.

## 5. Read the records

[`GET /v1/account/text_consents`](https://provenanceauth.com/docs/api/account.md#get-v1-account-text-consents) lists your records, newest first.

| Query | What it does |
| --- | --- |
| `phone` | Looks one phone up by its full number |
| `status` | `active` or `withdrawn` |
| `source` | `step`, `box`, `keyword`, `statement` or `import` |

Each record carries the masked phone, how it was given, the method or wording version, the request or import it came with, and when it was granted and withdrawn. `stopped` is true on an active record whose phone replied STOP: texts to it still will not go.

A `step` record also carries `delivery`: how the step's link reached the person.

| `delivery` | When |
| --- | --- |
| `provenance` | Provenance sent the link (the request's email or text, an invite it sent), or the person agreed in their own Provenance app. You never held the link. |
| `company` | You delivered the link or also held it: a cart approval's `approve_url`, `delivery: "self"`, your own app link, an embed token, or your app given a link token. |

A `company` record shows the step was completed with that link, not that the person tapped it. Keep your own record of how you sent the link.

In the console, **Settings › Texts › Agreed to texts** (**View** on the Consent card) lists the same records: the phone, the way in (**Before a request**, **Your site's form**, **Your app**, **You said**, **Imported**, **Replied START**), the date and the status, with **Export** for a CSV.

The place a person agreed, their IP address and their browser are kept for evidence only. A signed-in owner or admin gets them with [`POST /v1/account/text_consents/evidence_exports`](https://provenanceauth.com/docs/api/account.md#post-v1-account-text-consents-evidence-exports), per record or for a date range.

## 6. Withdrawals and STOP

A person withdraws by replying STOP to your number, with **Withdraw** on the **Manage texts** page, or in the app's **Texts**, and STOP always wins: the phone is stopped for your texts until the person texts START to your number or agrees again in the Provenance app. START writes a new consent.

A statement or an import from you never lifts a stop, and neither does the opt-in step from a link or an embed, nor the consent box: anyone can type a phone into a form, so a tick isn't proof the phone is theirs.

When the box is ticked for a stopped phone, the tick is recorded with `stopped: true` and texts stay paused. The box tells the person: "You opted out earlier. Text START to +14155550100 to get texts again.", with your approved number, or "You opted out earlier. Reply START to any text from Pellowmarsh Clinics to get texts again." before you have one. No confirmation text goes (`confirmation: "not_applicable"`).

When a person withdraws another way, record it with [`POST /v1/account/text_consents/{id}/withdraw`](https://provenanceauth.com/docs/api/account.md#post-v1-account-text-consents-id-withdraw), or with **Withdraw** on the record in **Agreed to texts**. It takes effect before your next text. The `text_consent.granted` and `text_consent.withdrawn` [webhooks](https://provenanceauth.com/docs/integrate/webhooks.md) tell you about each change; an import sends one `text_consent_import.completed` instead of one `text_consent.granted` per row.

## 7. Retention and deletion

A record is kept while it is active and for four years after it is withdrawn, then deleted. A person who deletes their Provenance account leaves your consents in place: they withdraw by STOP or **Manage texts**. An import's counts are kept for four years. Your account export lists every record with its phone, and every import. Deleting your account deletes every record, import and setting.

## 8. Put the consent box on your own form

The consent box asks on your own sign-up or intake form, in either mode: one checkbox, unticked, with Provenance's wording beside it, the small **Terms** · **Privacy** links and the Provenance mark. Your styles can't change or hide its words, its box or its mark.

Ticking it records the person's own act: a record with `source: "box"`, shown as **Your site's form** (or **Your app** from React Native, Swift or Kotlin) in **Agreed to texts**. **Settings › Texts › Consent › Your site's form** shows your box's id and the code below.

**Mint a token on your backend.** Your box's id is `box_id` on [`GET /v1/account/text_consent`](https://provenanceauth.com/docs/api/account.md#get-v1-account-text-consent). Mint a short-lived embed token for it with [`POST /v1/embed/tokens`](https://provenanceauth.com/docs/api/embeds.md#post-v1-embed-tokens), the same way as every [embed](https://provenanceauth.com/docs/embeds.md).

**curl**

```bash norun
curl -X POST $PROVENANCE_API/v1/embed/tokens \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "widget": "text_consent", "object_id": "tcf_93d6ba7f74b3f3c311fbbba7" }'
```

**Put the box in your form.** Load the embed script as in [Embeds](https://provenanceauth.com/docs/embeds.md#3-render-the-widget), then add `<provenance-text-consent>` under your phone field. `phone-field` points at your own input; without it the box shows a phone field of its own.

**HTML**

```html
<form action="/book" method="post">
  <input id="mobile" name="mobile" type="tel" autocomplete="tel">
  <provenance-text-consent
    phone-field="#mobile"
    base-url="https://sandbox-api.provenanceauth.com"
    publishable-key="prv_pub_1D10TzJo8F73Z7ZHhWGKPpn0K7suJ0se"
    embed-token="emb_qZEiUQvIiNdSO2MoRzQBSHr4tJXmvQJPzbjMOkLNO24">
  </provenance-text-consent>
  <button type="submit">Book visit</button>
</form>
```

**React**

```tsx
import { TextConsent } from "@provenance/embed/react";

<TextConsent
  baseUrl="https://sandbox-api.provenanceauth.com"
  publishableKey={publishableKey}
  embedToken={textConsentToken}
  phoneField="#mobile"
  onConsented={({ consent_id }) => setConsentId(consent_id)}
/>;
```

**React Native**

```tsx
import { TextConsent } from "@provenanceauth/react-native";

<TextConsent
  baseUrl="https://sandbox-api.provenanceauth.com"
  publishableKey={publishableKey}
  embedToken={textConsentToken}
  phone={mobile}
  onConsented={({ consentId }) => setConsentId(consentId)}
/>;
```

**Swift**

```swift
import ProvenanceTextConsent

TextConsentView(
    baseURL: apiURL,
    publishableKey: publishableKey,
    embedToken: textConsentToken,
    phone: mobile
) { consentId in
    self.consentId = consentId
}
```

**Kotlin**

```kotlin
import com.provenanceauth.textconsent.TextConsent

TextConsent(
    baseUrl = apiUrl,
    publishableKey = publishableKey,
    embedToken = textConsentToken,
    phone = mobile,
) { consentId ->
    viewModel.consentId = consentId
}
```

The React Native box needs the [native SDK](https://provenanceauth.com/docs/attest/guides/native-sdk.md); the Swift and Kotlin boxes are in their own packages ([Swift](https://provenanceauth.com/docs/messaging/text-consent/swift.md), [Kotlin](https://provenanceauth.com/docs/messaging/text-consent/kotlin.md)). An app's box needs a publishable key with no allowed origins, because an app sends none.

**Check it on your backend.** When the person ticks the box with a valid phone, the box records the consent, fires `pv:consented` with `{ consent_id }` and writes the id into a hidden `provenance_text_consent` field, so your form submits it.

The event comes from the browser: read the record with [`GET /v1/account/text_consents/{id}`](https://provenanceauth.com/docs/api/account.md#get-v1-account-text-consents-id) before you rely on it. The record carries `form_origin`, the page the box ran on. If the person unticks the box before the token expires, that record is withdrawn and the field cleared (`pv:consent_withdrawn`).

A phone that already agreed is answered with its record as it is. Right after a new consent, the one confirmation text goes from your number, as after the step. A phone that replied STOP to you stays stopped: the answer carries `stopped: true` and `start_number`, and the box shows the person how to text START ([Withdrawals and STOP](#6-withdrawals-and-stop)). On the Free plan the box renders nothing.

Each tick can send a confirmation text you pay for, so your account's box records up to 500 ticks a day, whichever token or address they come from. Past that it answers `429 rate_limit_exceeded` and records nothing until the day's window ends.

The page is yours, so the record says the box was ticked on your form, not who ticked it.

## 9. What the carriers are sent

Your [sending number](https://provenanceauth.com/docs/messaging/sending-numbers.md)'s registration shows the carriers how people agree to your texts with images, never a public page and never a person's details.

| Your mode | The opt-in type | The images |
| --- | --- | --- |
| **Provenance asks** | `WEB_FORM` | The opt-in step and, once your consent box has recorded anyone, the box, drawn from the same markup people see, with a sample number |
| **We have it** | From **How people agree** | Your screenshots, or with none an image of your statement: your name, the method and the date |

Under **We have it**, add up to five screenshots of your own opt-in (PNG or JPEG, up to 5 MB each) in **Settings › Texts › Consent › Screenshots**, or with [`POST /v1/account/text_consent/screenshots`](https://provenanceauth.com/docs/api/account.md#post-v1-account-text-consent-screenshots) and the image as the body. The next registration or resubmission sends them. On Pro and above.

Each registration and resubmission sends new links under a fresh token. A link answers only while that review runs: approval, a release, or a new review ends it. `opt_in_images` on the number names what was sent, and the console shows each image under **Sent to the carriers**.

## 10. When a text goes

A text from your number goes only to a phone with a consent on record. Before each text, in this order:

| The check | When it holds | What `deliveries` says |
| --- | --- | --- |
| Your plan | You're on Free | `plan_send_limit` |
| Your number | You have no approved [sending number](https://provenanceauth.com/docs/messaging/sending-numbers.md) | `sender_not_ready` |
| A stop | The phone replied STOP to your number, or withdrew | `opted_out` |
| A consent | The phone has no active record, and you have no statement for everyone | `no_text_consent` |

A consent is an active record of any kind: the step, the box, START, your statement or an import. Under **We have it** with **Everyone we text**, every phone you give passes. STOP is checked first and always wins.

A text held for want of consent is reported like any text that can't go. The email goes in its place when the request carries one, and under **Provenance asks** it carries **Also text me** into the step. With a phone only, nothing is sent and the request stays open:

```json
{
  "delivery": { "channel": "text", "delivered": false, "reason": "no_text_consent" },
  "deliveries": [
    { "recipient": "•••• 0132", "channel": "text", "channel_reason": "default", "status": "not_sent", "reason": "no_text_consent" }
  ]
}
```

In the console the request's **Delivery** row reads **Not sent · No consent**.

**On the request.** A request's read carries `contact.text_consent`, the consent in force for its phone at the time you read it:

```json
{
  "contact": {
    "phone": "+14•••32",
    "text_consent": { "status": "active", "source": "step", "granted_at": "2026-11-15T18:24:00Z" }
  }
}
```

| Field | What it says |
| --- | --- |
| `status` | `active`, or `none` when no consent is on record |
| `source` | With `active`: how the person agreed, or `everyone` for your statement for everyone |
| `granted_at` | With `active`: when it was recorded |
| `withdrawn_at` | With `none`: when the phone's latest consent was withdrawn |

Capture requests carry it on every read, the list included; cart approvals on create and read; invites on create and in their list.

A text that went names the record it went under as `consent_id` on its `deliveries` entry. Under your statement for everyone there is no record to name.

In the console the request's Summary card shows **Texts**: **Agreed before the request · 1:24 pm**, **You said · Nov 2**, **Not agreed** or **Stopped**.

- **Reminders.** A reminder whose text is held goes by email with `channel_reason: "text_no_consent"`. With no email, nothing goes and the reminder says why. The request's `reminders.next_channel_reason` says `text_no_consent` before you send one ([reminders](https://provenanceauth.com/docs/messaging/reminders.md#2-read-what-happened)).
- **The follow-up text.** It isn't scheduled for a phone with no consent: the entry reads `not_sent` with `no_text_consent` at once, and no webhook follows.
- **Later.** Once a consent is recorded, the next reminder's text and later requests can go. A follow-up already held stays held.
- **Texts from Provenance** to your own people, such as sign-in codes, never need your consent records.

**In the sandbox.** Every number counts as agreed except `+12025550104`, which acts out a phone with no consent: requests to it read `no_text_consent` until you record a statement for it, or the person agrees in the step ([test texts in the sandbox](https://provenanceauth.com/docs/messaging/test-texts.md)).

## Errors you might see

| Code | When |
| --- | --- |
| `text_consent_mode_mismatch` (409) | A statement or a screenshot while the mode is not `company`; a request carrying a statement is not created |
| `plan_required` (402) | A statement, an import, a screenshot or the consent box on the Free plan |
| `embed_token_invalid` (401) | The box's token expired or was minted for another widget; mint a fresh one for your `box_id` |
| `text_consent_link_expired` (400) | A **Manage texts** link more than 90 days old; nothing changed |
| `text_consent_withdrawn` (409) | Withdrawing a record that was already withdrawn; `error.details.withdrawn_at` says when |
| `parameter_invalid` (400) | A field is missing or malformed; `param` names it, such as `contact.text_consent.obtained_at`, or `file` for an import file that adds nothing |
| `text_consent_screenshots_full` (409) | You already have five screenshots; delete one first |
| `consent_evidence_too_large` (413) | A screenshot over 5 MB |
| `text_consents_unavailable` (503) | The records couldn't be read or written; nothing was recorded. Retry |

## See also

- [Texts from companies](https://provenanceauth.com/help/personal/guides/texts-from-companies): what the person sees
- [Text consent for Swift](https://provenanceauth.com/docs/messaging/text-consent/swift.md) and [for Kotlin](https://provenanceauth.com/docs/messaging/text-consent/kotlin.md): the step and the box in your own app
- [Reminders](https://provenanceauth.com/docs/messaging/reminders.md): the stop list STOP and START write to
- [Webhooks](https://provenanceauth.com/docs/integrate/webhooks.md): the consent and import events
- [Errors](https://provenanceauth.com/docs/platform/errors.md): every error code
