Changelog · back to all

PHP SDK: install messagebird/sdk from Composer

feature

Bird has an official PHP SDK. composer require messagebird/sdk gives you a typed client over the same curated surface the Go, TypeScript, and Python SDKs cover, so a PHP service no longer has to hand-roll HTTP calls against the API.

It targets PHP 8.2+ and is synchronous. Requests go through any PSR-18 client you already have, Guzzle or Symfony HttpClient included, discovered automatically. Nothing pins you to a transport, and per-request timeouts stay where you already configure them.

What you get

  • The curated surface, method for method with the other SDKs: email (send, batch, get, list, cancel, stats, mailboxes, threads), SMS and its templates, WhatsApp, Verify, contacts, contact properties, audiences, domains, and realtime.
  • A one-argument client. Only the API key is required. The region comes from the key's bk_{region}_ prefix, so a bk_eu1_… key routes to EU with no extra configuration.
  • Retries and idempotency you don't write. Transient failures retry with jittered backoff and honor Retry-After, and every mutation, DELETE included, carries an idempotency key generated once and reused across attempts. A retry cannot act twice.
  • Errors as exceptions. A failed call raises ApiException carrying the HTTP status plus the API's own error type and code, so you branch on a stable value instead of parsing a message.
  • Webhook verification. $bird->webhooks->unwrap() checks a Standard Webhooks signature against your signing secret and hands back the verified payload.
  • An escape hatch for the long tail. get, post, put, patch, and delete on the client reach any endpoint directly, so a newly shipped API operation never waits on an SDK release.

Not in this release

Framework packages. The quickstart is a plain PHP script, and there is no Laravel or Symfony integration yet. The client itself works inside either framework today; what is missing is the idiomatic wrapper, which is on the roadmap.

To send something, start with the PHP email quickstart. For the client's configuration, retry, and error model, see the PHP SDK reference.

Starten Sie mit einem Kanal.
Fügen Sie die anderen hinzu, wenn Sie bereit sind.

Ein Test-API-Key steht Ihnen sofort zur Verfügung. Der Produktivzugang wird freigeschaltet, sobald Sie eine Zahlungsmethode hinzufügen und einen Absender verifizieren.

Sie nutzen Claude Code, Cursor oder Codex? Kopieren Sie einen Setup-Prompt und Ihr Agent installiert die Bird CLI und Skills für Sie. Wählen Sie Ihren:

Cursor