Skip to main content

1. Create an account & get your API key

Sign up at app.messages.dev, then go to API Keys in the sidebar and click Create Key. Copy the key. It starts with sk_live_ and is only shown once.
Store your API key somewhere safe. It won’t be displayed again. If you lose it, revoke it from the dashboard and create a new one.

2. Activate your sandbox

Go to the Lines page in your dashboard. You’ll see a sandbox card with a QR code and an activation code. Scan the QR code with your phone (it opens a pre-filled text message) or manually text the code to the sandbox number. Once your message is received, your sandbox is activated and your phone number is paired. You get 50 free messages per day.
The sandbox is a shared iMessage line for testing. For production use, set up a dedicated line.

3. Install the SDK (optional)

npm install @messages-dev/sdk
The SDK is optional. You can use any HTTP client or curl instead. All examples below show both.

4. Send a message

Every message is sent from a line. If you activated the sandbox, use the sandbox line handle and your paired phone number. You can find your line handle on the Lines page in the dashboard.
import { createClient } from "@messages-dev/sdk";

const client = createClient();

await client.sendMessage({
  from: "+15551234567",
  to: "+15559876543",
  text: "Hello from Messages.dev!",
});
That’s it. Your first message is on its way.

5. Receive messages

Register a webhook to get notified when messages come in. Go to the Webhooks page in your dashboard, click Add Webhook, enter your endpoint URL, and select the events you want. Copy the signing secret; you’ll need it to verify deliveries. Then handle incoming events on your server:
import { verifyWebhook } from "@messages-dev/sdk";

app.post("/webhooks", (req, res) => {
  const event = await verifyWebhook(
    req.body,
    req.headers["x-webhook-signature"],
    "your_webhook_secret",
  );

  if (event.event === "message.received") {
    console.log(`${event.data.sender}: ${event.data.text}`);
  }

  res.sendStatus(200);
});

6. List your lines (optional)

If you need to look up your line handles programmatically:
await client.listLines();

Next steps

Send Messages

Delivery tracking and error handling

Receive Messages

Webhooks for real-time message delivery

TypeScript SDK

Full SDK reference: pagination, error handling, types

API Reference

All endpoints