The official Go SDK for the Bird email platform.
go get github.com/messagebird/bird-sdk-goRequires Go 1.24+.
This SDK is generated from Bird's public OpenAPI bundle inside Bird's internal monorepo, which is the single source of truth; this repository tracks tagged releases. Generation runs in the monorepo, so
make generatewon't work from a clone here — see CONTRIBUTING.md.
bird.NewClient(option.WithAPIKey(...)) returns a client whose region is inferred from the API key's prefix (bk_{region}_…); pass option.WithBaseURL or option.WithRegion to override. From there:
client.Email—Send,Get,List(auto-paginating;ListPagefor manual cursors).client.Whatsapp—Send(template messages),Get,List(auto-paginating;ListPagefor manual cursors),ListEvents(a message's delivery timeline).client.WhatsappTemplatesreads the template catalogue.client.Webhooks—Unwrap(verify a signed event into a typed value).- Typed errors. A failure is a
*bird.APIError(or a richer*bird.RateLimitError/*bird.ValidationError) you branch on witherrors.As. Transient failures (timeouts, 429, 5xx) are retried automatically with a reused idempotency key. - Options configure the client and override per call (
option.WithEmailDefaults,WithTimeout,WithIdempotencyKey, …). client.Get/Post/Put/Patch/Deletereach endpoints outside the curated surface.
Runnable, per-method examples live in example_test.go and render under each method on pkg.go.dev: sending (simple and rich), error handling, get, pagination, channel defaults, the webhook receiver, and the escape hatch.
The wire types and a low-level client are generated from the OpenAPI spec into internal/oapi; this package is the hand-written idiomatic layer on top.