You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
# Changelog
2
2
3
+
## 0.20.0
4
+
5
+
- Voice call webhook payloads name the two parties from and to, replacing src_number and dst_number. A handler reading those fields on voice_call.initiated, voice_call.answered or voice_call.ended must rename them; every other field is unchanged.
6
+
- WhatsApp and SMS template `language` fields now take a BCP-47 tag (for example `pt-BR`); Meta's underscore form (`pt_BR`) is still accepted as an input alias but is no longer echoed back. WhatsApp template sends can now also address a template by `id`, as an alternative to `slug`: the existing `template` argument takes either, resolving a `wat_`-prefixed value as the id — the same convention it already uses for SMS's `smt_`.
7
+
- WhatsApp send: the `to` field now accepts a business-scoped user ID as well as an E.164 phone number, so you can message a WhatsApp user whose phone number you do not have. One-time-passcode templates still require a phone number and return `422 WhatsAppRecipientNotSupportedForTemplate` when sent to a business-scoped user ID.
8
+
3
9
## 0.19.0
4
10
5
11
- Add a `datetime` contact property type: an RFC 3339 timestamp with an explicit offset.
@@ -2089,8 +2089,9 @@ class SMSTemplateSend1(BaseModel):
2089
2089
language: Annotated[
2090
2090
str|None,
2091
2091
Field(
2092
-
description="Language tag (BCP 47, for example `fr` or `pt-BR`) selecting the localized body. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.\n",
2092
+
description="Which of the template's localized bodies to send, as a BCP-47 tag. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.\n",
2093
2093
examples=["fr"],
2094
+
max_length=35,
2094
2095
min_length=2,
2095
2096
),
2096
2097
] =None
@@ -2129,8 +2130,9 @@ class SMSTemplateSend2(BaseModel):
2129
2130
language: Annotated[
2130
2131
str|None,
2131
2132
Field(
2132
-
description="Language tag (BCP 47, for example `fr` or `pt-BR`) selecting the localized body. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.\n",
2133
+
description="Which of the template's localized bodies to send, as a BCP-47 tag. Falls back to the closest available language, then English, when the exact tag is not stocked. Omit for English.\n",
2133
2134
examples=["fr"],
2135
+
max_length=35,
2134
2136
min_length=2,
2135
2137
),
2136
2138
] =None
@@ -2965,9 +2967,10 @@ class WhatsAppMessageTemplate(BaseModel):
2965
2967
language: Annotated[
2966
2968
str,
2967
2969
Field(
2968
-
description="The language code of the template variant that was sent (for example `en`).",
2969
-
examples=["en"],
2970
-
min_length=1,
2970
+
description="The canonical BCP-47 tag of the template variant that was sent.",
2971
+
examples=["pt-BR"],
2972
+
max_length=35,
2973
+
min_length=2,
2971
2974
),
2972
2975
]
2973
2976
components: Annotated[
@@ -3105,10 +3108,59 @@ class WhatsAppMessageList(FieldListEnvelope):
3105
3108
]
3106
3109
3107
3110
3108
-
classWhatsAppTemplateSend(BaseModel):
3111
+
classWhatsAppTemplateSend1(BaseModel):
3112
+
model_config=ConfigDict(
3113
+
extra="allow",
3114
+
)
3115
+
id: Annotated[
3116
+
str,
3117
+
Field(
3118
+
description="The template to send, by its id.",
3119
+
examples=["wat_01krdgeqcxet5s7t44vh8rt9mg"],
3120
+
min_length=1,
3121
+
pattern="^wat_[0-9a-hjkmnp-tv-z]{26}$",
3122
+
),
3123
+
]
3124
+
slug: Annotated[
3125
+
str|None,
3126
+
Field(
3127
+
description="The template to send, by its slug (for example `bird_otp`).",
3128
+
examples=["bird_otp"],
3129
+
max_length=63,
3130
+
min_length=1,
3131
+
pattern="^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$",
3132
+
),
3133
+
] =None
3134
+
language: Annotated[
3135
+
str|None,
3136
+
Field(
3137
+
description="Which of the template's languages to send, as a BCP-47 tag (for example `en` or `pt-BR`). Meta's underscore form (`pt_BR`) is accepted and normalized; the accepted message echoes the canonical BCP-47 form. May be omitted when the template has a single language; when it is stocked in several, omitting the language returns a `422` that names the available tags.\n",
3138
+
examples=["pt-BR"],
3139
+
max_length=35,
3140
+
min_length=2,
3141
+
),
3142
+
] =None
3143
+
components: Annotated[
3144
+
list[WhatsAppMessageTemplateComponent] |None,
3145
+
Field(
3146
+
description="The values that fill the template's placeholders: one entry per content block that has placeholders, each carrying its `parameters`. A positional template takes its parameters in `{{n}}` order; a template with named parameters requires each parameter's `name` to match one the template declares. Either way, sending parameters that do not match what the template declares returns a `422` `WhatsAppTemplateParameterMismatch`.\n"
3147
+
),
3148
+
] =None
3149
+
3150
+
3151
+
classWhatsAppTemplateSend2(BaseModel):
3109
3152
model_config=ConfigDict(
3110
3153
extra="allow",
3111
3154
)
3155
+
id: Annotated[
3156
+
str|None,
3157
+
Field(
3158
+
description="The template to send, by its id.",
3159
+
examples=["wat_01krdgeqcxet5s7t44vh8rt9mg"],
3160
+
min_length=1,
3161
+
pattern="^wat_[0-9a-hjkmnp-tv-z]{26}$",
3162
+
),
3163
+
] =None
3112
3164
slug: Annotated[
3113
3165
str,
3114
3166
Field(
@@ -3122,9 +3174,10 @@ class WhatsAppTemplateSend(BaseModel):
3122
3174
language: Annotated[
3123
3175
str|None,
3124
3176
Field(
3125
-
description="Language code of the template variant to send (for example `en` or `pt_BR`). May be omitted when the template has a single language; when it is stocked in several, omitting the language returns a `422` that names the available codes. The accepted message echoes the resolved language.\n",
3126
-
examples=["en"],
3127
-
min_length=1,
3177
+
description="Which of the template's languages to send, as a BCP-47 tag (for example `en` or `pt-BR`). Meta's underscore form (`pt_BR`) is accepted and normalized; the accepted message echoes the canonical BCP-47 form. May be omitted when the template has a single language; when it is stocked in several, omitting the language returns a `422` that names the available tags.\n",
3178
+
examples=["pt-BR"],
3179
+
max_length=35,
3180
+
min_length=2,
3128
3181
),
3129
3182
] =None
3130
3183
components: Annotated[
@@ -3142,15 +3195,58 @@ class WhatsAppMessageSendRequest(BaseModel):
3142
3195
to: Annotated[
3143
3196
str,
3144
3197
Field(
3145
-
description="The message recipient's phone number in E.164 format (for example `+31612345678`). A value that is not a valid phone number returns a `422` `WhatsAppInvalidRecipient`.\n",
3198
+
description="The message recipient: a phone number in E.164 format (for example `+31612345678`), or the recipient's business-scoped user ID (for example `US.13491208655302741918`), which addresses a WhatsApp user whose phone number you do not have. A value that is neither returns a `422` `WhatsAppInvalidRecipient`. One-time-passcode templates require a phone number and return a `422` `WhatsAppRecipientNotSupportedForTemplate` when sent to a business-scoped user ID.\n",
3146
3199
examples=["+31612345678"],
3147
3200
min_length=1,
3148
3201
),
3149
3202
]
3150
3203
template: Annotated[
3151
-
WhatsAppTemplateSend|None,
3204
+
WhatsAppTemplateSend1|WhatsAppTemplateSend2|None,
3152
3205
Field(
3153
-
description="The template to send. Bird selects the sender number from the template's category, so there is no sender field on this request. Templates are the only supported content type today: a request without one is rejected with a `422`.\n"
3206
+
description="The template to send. Bird selects the sender number from the template's category, so there is no sender field on this request. Templates are the only supported content type today: a request without one is rejected with a `422`.\n",
@@ -5532,7 +5628,7 @@ class MailboxCreate(BaseModel):
5532
5628
retention_tier: Annotated[
5533
5629
RetentionTier1|None,
5534
5630
Field(
5535
-
description="How long the mailbox remembers message metadata and extracted text. Original rendered source is always available for 30 days regardless of tier. Only `30d` is available today; longer tiers (`90d`, `1y`, and beyond) are coming soon."
5631
+
description="How long the mailbox remembers message metadata and extracted text. Original rendered source is always available for 30 days regardless of tier. Only `30d` is available today; additional tiers are planned."
5536
5632
),
5537
5633
] ="30d"
5538
5634
metadata: Annotated[
@@ -5567,7 +5663,7 @@ class MailboxUpdate(BaseModel):
5567
5663
retention_tier: Annotated[
5568
5664
RetentionTier1|None,
5569
5665
Field(
5570
-
description="How long the mailbox remembers message metadata and extracted text. Lowering the tier deletes memory older than the new horizon and requires `confirm=true` when messages older than the new horizon would be deleted. Only `30d` is available today; longer tiers (`90d`, `1y`, and beyond) are coming soon."
5666
+
description="How long the mailbox remembers message metadata and extracted text. Lowering the tier deletes memory older than the new horizon and requires `confirm=true` when messages older than the new horizon would be deleted. Only `30d` is available today; additional tiers are planned."
5571
5667
),
5572
5668
] ="30d"
5573
5669
metadata: Annotated[
@@ -8606,15 +8702,16 @@ class EventVoiceBase(BaseModel):
8606
8702
),
8607
8703
]
8608
8704
direction: VoiceCallDirection
8609
-
src_number: Annotated[
8705
+
from_: Annotated[
8610
8706
str,
8611
8707
Field(
8708
+
alias="from",
8612
8709
description="Calling party number in E.164 format.",
8613
8710
examples=["+14155551234"],
8614
8711
min_length=1,
8615
8712
),
8616
8713
]
8617
-
dst_number: Annotated[
8714
+
to: Annotated[
8618
8715
str,
8619
8716
Field(
8620
8717
description="Called party number in E.164 format.",
Copy file name to clipboardExpand all lines: src/bird/resources/contact_properties_gen.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ def update(
121
121
fallback_value: Any|None=None,
122
122
options: RequestOptions|None=None,
123
123
) ->ContactProperty:
124
-
"""Update a contact property's fallback value. The key and type are immutable; create a new property instead.
124
+
"""Update a contact property's fallback value. Only the fallback value can change; the key and type are fixed at creation, so a different key or type needs a new property.
"""Update a contact property's fallback value. The key and type are immutable; create a new property instead.
267
+
"""Update a contact property's fallback value. Only the fallback value can change; the key and type are fixed at creation, so a different key or type needs a new property.
0 commit comments