MessageBird (now Bird)
MessageBird rebranded as Bird in February 2024. The old messagebird PyPI package (last version 2.2.0, released 2022) is no longer maintained and targets the legacy API. The new Python SDK is bird-python on PyPI, targeting the Bird API at docs.bird.com. LLMs almost universally generate the old package name.
Warnings
- breaking MessageBird rebranded as Bird in February 2024. The messagebird PyPI package (2.2.0) is unmaintained and targets the legacy API. New features (workspaces, channels, WhatsApp via Bird API) are only available in the bird-python package.
- breaking The new Bird API has a completely different message-sending model. Instead of client.message_create(src, dst, text), it uses workspace + channel selection followed by client.send_message(channels_id, body). All old code patterns break.
- gotcha Both the old messagebird package and the new bird-python package use import messagebird as the import statement. This makes it impossible to tell from the import line alone which API version the code targets.
- gotcha Access keys from the old MessageBird dashboard may not work with the new Bird API. The Bird platform uses a new authentication system via manage.bird.com.
Install
-
pip install messagebird -
pip install bird-python
Imports
- messagebird.Client
# New Bird SDK (post-rebrand 2024): import messagebird # import name still messagebird inside bird-python client = messagebird.Client('YOUR_ACCESS_KEY') # Legacy API (still works against old rest.messagebird.com): import messagebird client = messagebird.Client('YOUR_ACCESS_KEY') msg = client.message_create('+31612345678', ['+14155551234'], 'Hello!')
Quickstart
# Install: pip install bird-python
import messagebird # import name unchanged in bird-python
client = messagebird.Client('YOUR_ACCESS_KEY')
try:
# New Bird API — workspace + channel based
client.workspaces = client.workspace_list()['results'][0]['id']
channel_id = client.channel_list()['results'][0]['id']
response = client.send_message(
channels_id=channel_id,
body={
'receiver': {
'contacts': [{'identifierValue': '+14155551234'}]
},
'body': {
'type': 'text',
'text': {'text': 'Hello from Bird!'}
}
}
)
except messagebird.client.ErrorException as e:
for error in e.errors:
print(error.description)