Sign inGet started

bird preferences create

Usage

Codebeispiel
bird preferences create [flags]

Description

Record a preference
Record a consent grant or an opt-out for a handle on one channel. An upsert by key: the same channel, handle, and sender scope update one record, and an out-of-order statement is refused with applied: false rather than applied.
Build the request from flags, a JSON PreferenceCreate body via --body-file ("-" reads stdin), or both — a flag overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.

Examples

Codebeispiel
# print the body shape (no credentials needed)
bird preferences create --example

# the body it prints:
Codebeispiel
{
  "channel": "sms",
  "coverage": "non_transactional",
  "handle": "+15550001234",
  "status": "revoked"
}

Options

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice

Options

NameDescription
--handleWho the statement is about: an email address on the email channel, a phone number in E.164 format on SMS and WhatsApp. (required; or in --body-file)
--channelThe channel a preference statement applies to. A preference addresses one channel: the handle that identifies the person differs per channel, so opting out of one channel says nothing about the others. New channels can be added over time, so a value outside this list can be returned. Known values: email, sms, whatsapp (others may exist). (required; or in --body-file)
--statusWhat the statement says: granted records consent to receive messages, revoked records an opt-out. There is no third state: a person who never stated anything simply has no preference on record. Possible values: granted, revoked. (required; or in --body-file)
--coverageHow much traffic the statement covers. Defaults to non_transactional, which keeps transactional messages such as receipts and verification codes flowing. Possible values: all, non_transactional.
--sender-scopeLimit the statement to one sender instead of the whole channel. On SMS this is the originator; on WhatsApp it identifies the business account. Not supported on email, where preferences are always channel-wide.
--sourceFree-form note on where the statement came from: a form name, an import batch, a campaign. Stored verbatim and returned on the preference.
--consented-atWhen the person consented, on a granted statement. Required evidence when granting over a stored opt-out: the grant applies only if this is later than the opt-out it reverses. May not be in the future.
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird preferences deleteDelete a preference
bird preferences getGet a preference
bird preferences listList preferences