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
| Name | Description |
|---|---|
--body-file | Read the JSON request body from this file; "-" reads stdin |
--example | Print a complete example request body, then exit |
--dry-run | Print the resolved request without sending it, then exit |
--idempotency-key | Deduplication key; a retry with the same key won't act twice |
Options
| Name | Description |
|---|---|
--handle | Who the statement is about: an email address on the email channel, a phone number in E.164 format on SMS, WhatsApp, and Apple Messages for Business. (required; or in --body-file) |
--channel | The 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, amb (others may exist). (required; or in --body-file) |
--status | What 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) |
--coverage | How much traffic the statement covers. Defaults to non_transactional, which keeps transactional messages such as receipts and verification codes flowing. Apple Messages for Business phone invitations have no transactional exemption, so either value covers them. Possible values: all, non_transactional. |
--sender-scope | Limit the statement to one sender instead of the whole channel. On SMS this is the originator; on WhatsApp it identifies the business account; on Apple Messages for Business it is the Apple business ID used for invitations. Not supported on email, where preferences are always channel-wide. |
--source | Free-form note on where the statement came from: a form name, an import batch, a campaign. Stored verbatim and returned on the preference. |
--consented-at | When 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-schema | Print the fields this command returns, then exit |
Related
| Name | Description |
|---|---|
bird preferences delete | Delete a preference |
bird preferences get | Get a preference |
bird preferences list | List preferences |
Verwandte Ressourcen
Weiter mit der Dokumentation, Anleitungen und Beispielen zu diesem Thema.