Quickstart

Send a WhatsApp message from your own code. Five minutes, and nothing you send in this guide reaches a real phone.

Before you start

You need two things from the console:

  • A channel: the WhatsApp number messages are sent from. Connect one under Channels.
  • An API key. Start with a pgn_test_ key.

1. Check your key

Before sending anything, confirm the key you just pasted is the one you think it is.

curl
curl https://api.pigeon.dev/v1/whoami \
  -H "Authorization: Bearer pgn_test_your_key"

It answers with the project, the environment and the key's role. If this returns INVALID_API_KEY, the key was not copied whole: the pgn_test_ prefix is part of it.

2. Send a message

curl
curl -X POST https://api.pigeon.dev/v1/messages \
  -H "Authorization: Bearer pgn_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "ch_01h9",
    "to": "+256700000000",
    "type": "text",
    "body": "Your order has shipped."
  }'

You get back the message as Pigeon stored it:

201 Created
{
  "data": {
    "id": "01a2120c-38cb-7376-b188-84cef21dc768",
    "channel_id": "ch_01h9",
    "direction": "outbound",
    "from": "+256771111111",
    "to": "+256700000000",
    "type": "text",
    "status": "sent",
    "environment": "test",
    "created_at": "2026-11-25T12:04:21Z"
  },
  "message": "Message accepted."
}

status is where the message has got to, not whether it arrived. It moves forward on its own as the provider reports back: queued → sent → delivered → read. To find out when it changes, use webhooks rather than polling.

The same thing in Go

Go
import pigeon "github.com/MUKE-coder/pigeon/sdks/go"

client := pigeon.New("pgn_test_your_key")

msg, err := client.Messages.Send(ctx, &pigeon.SendRequest{
    ChannelID: "ch_01h9",
    To:        "+256700000000",
    Body:      "Your order has shipped.",
})

The Go SDK ships with the API in the same release. It has no dependencies beyond the standard library, every call takes a context, and every error carries a code you can switch on.

3. Go live

Swap the test key for a pgn_live_ one. Nothing else in your code changes: the environment is resolved from the key and from nowhere else, so there is no flag to forget and no staging URL to get wrong.