View as Markdown

SDK reference · Node SDK

prov.account.createTextConsent

prov.account.createTextConsent in Node SDK. Record that a phone agreed to your texts (mode company, Pro and up).

Signature

prov.account.createTextConsent(params: TextConsentStatement & { phone: string }): Promise<TextConsent>

Parameters

paramsTextConsentStatement & { phone: string }Required

Request fields

phonestringRequired
The phone in E.164 form, such as +14155550132.
methodenumRequired
How the person agreed. One of sign_up_form, in_app, in_person, customer_list.
obtained_attimestampRequired
When they agreed; not in the future.
evidence_urlstring
An https link to how they agreed. Stored, never fetched.

Returns

Promise<TextConsent> The new record. A phone that already has an active record gets that record back, as it is, with 200.

HTTP operation

POST /v1/account/text_consents: Record that a phone agreed to texts

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consent`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "mode": "company", "everyone": null }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "phone": "+14155550132",
    "method": "sign_up_form",
    "obtained_at": "2026-11-02T16:05:00Z",
    "evidence_url": "https://pellowmarsh.example/intake"
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.