SDK reference · Python SDK
prov.account.create_text_consent
prov.account.create_text_consent in Python SDK. Record that a phone agreed to your texts: phone, method, obtained_at, optional evidence_url.
Signature
prov.account.create_text_consent(**fields: Any = …) -> AnyParameters
**fieldsAny
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
httpslink to how they agreed. Stored, never fetched.
Returns
Any 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
- authentication_required
- parameter_invalid
- plan_required
- text_consent_mode_mismatch
- rate_limit_exceeded
- text_consents_unavailable
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();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.put(f"{api}/v1/account/text_consent", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"mode": "company",
"everyone": None
}).json()
data = httpx.post(f"{api}/v1/account/text_consents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"phone": "+14155550132",
"method": "sign_up_form",
"obtained_at": "2026-11-02T16:05:00Z",
"evidence_url": "https://pellowmarsh.example/intake"
}).json()