Skip to content

client.consents

Recorded marketing consent (§30A). These methods are on client.consents, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.

Record consents. Records marketing consent (§30A) for up to 1,000 numbers, with where it was given and what proves it. Needs a live key.

client.consents
def create(self, body: _m.ConsentsCreateBody | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.ConsentBatch

client.consents.create() · await async_client.consents.create() · POST /consents · API reference

Field Type Required Description
phones string[] yes Up to 1000 numbers that gave consent.
evidence string no What proves it: a form URL, a recording reference, a document ID.
granted_at string no When the consent was given (default: now). Not in the future.
source string no Where the consent was given (default api).

ConsentBatch:

Field Type Description
object "consent_batch" Always consent_batch.
livemode boolean true in live mode, false in test mode.
recorded string[] Numbers a consent record was added for (E.164).
invalid string[] Entries that are not valid phone numbers, as sent.
from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
consent_batch = client.consents.create({
"evidence": "https://example.com/forms/123",
"granted_at": "2026-10-30T12:00:00.000Z",
"phones": [
"+972501234567",
],
"source": "web_form",
})
print(consent_batch)

Revoke a number’s consent. Revokes every active consent of the number. The records stay (with revoked_at) as evidence. Needs a live key.

client.consents
def delete(self, phone: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.ConsentRevocation

client.consents.delete() · await async_client.consents.delete() · DELETE /consents/{phone} · API reference

Name Type Required Description
phone str yes The number (URL-encode the + as %2B).

ConsentRevocation:

Field Type Description
object "consent_revocation" Always consent_revocation.
livemode boolean true in live mode, false in test mode.
phone string —
revoked_at string An ISO-8601 timestamp in UTC.
from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
consent_revocation = client.consents.delete("+972501234567")
print(consent_revocation)

List consent records. Lists the recorded consents to be called (§30A), newest first. Filter by phone (any common format) or by active (false lists revoked records). Test keys can read the list; recording or revoking consent needs a live key.

client.consents
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, phone: str | Unset = UNSET, active: _m.ConsentsListActive | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.Consent]

client.consents.list() · await async_client.consents.list() · GET /consents · API reference

Name Type Required Description
limit integer no How many objects to return, 1–100 (default 20).
starting_after string no A cursor (next_cursor) or object ID: return the objects after it (older).
ending_before string no A cursor or object ID: return the objects before it (newer).
phone string no Only this number (any common form).
active "true" | "false" no Only active (true) or only revoked (false) records.

A page of results (ConsentList): data, has_more and next_cursor.

from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
for consent in client.consents.list():
print(consent)