SDK reference · Python SDK
prov.account.withdraw_text_consent
prov.account.withdraw_text_consent in Python SDK. Record a withdrawal you received another way; the phone is stopped for your texts.
Signature
prov.account.withdraw_text_consent(consent_id: str) -> AnyParameters
consent_idstrRequired
Request fields
idstringpathRequired- The consent's id (
tcon_…).
Returns
Any The record, withdrawn.
HTTP operation
POST /v1/account/text_consents/{id}/withdraw: Withdraw a consent to text
Errors
- authentication_required
- resource_missing
- text_consent_withdrawn
- 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 step2 = 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": "+14155550135",
"method": "customer_list",
"obtained_at": "2026-11-05T10:00:00Z"
}),
})).json();
const consentId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consents/${consentId}/withdraw`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).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()
step2 = httpx.post(f"{api}/v1/account/text_consents", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"phone": "+14155550135",
"method": "customer_list",
"obtained_at": "2026-11-05T10:00:00Z"
}).json()
consent_id = step2["id"]
data = httpx.post(f"{api}/v1/account/text_consents/{consent_id}/withdraw", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()