Skip to main content
Before you start
  • A Blujay workspace. Sign up free if you don’t have one. A new workspace starts on the Free Plan with a shared phone number.
  • Workspace owner or admin access. Only workspace owners and admins see the API tab.
  • Your own US mobile number. Blujay sends to US numbers only. Use your own phone as the recipient while you test: every API call sends real messages.
  • The Blujay app, if you’re on the Free Plan. A Free Plan number can message up to 10 verified contacts: people who texted the number first and were verified in the app. Verification happens in the app, not through the API (step 4). A Dedicated number skips that step. See Plans.
1

Get your API key

In Blujay, open API in the sidebar. Under API Token, reveal and copy your key. It starts with blu_.Keep it on your server, in an environment variable or secret manager. Never put it in a browser, a mobile app or source control.
2

Check that the key works

A 401 means the key is missing or wrong. See UNAUTHORIZED.
3

Pick a phone number to send from

Choose a number whose send_status.allowed is true, and note its display_number. POST /v1/chats takes that string as from. A Free Plan number shows access_type: "shared". A Dedicated number also reports its live sending limits and queue. See Phone numbers and limits.
4

Free Plan only: verify your phone

On the Free Plan, Blujay sends only to contacts who have texted your Free Plan number first and were verified in the app. Skip this step if your number is Dedicated.
  1. In Blujay, go to Contacts and choose Add verified contact.
  2. Enter your own mobile number and name.
  3. From your phone, text the message Blujay shows to your Free Plan number. Scan the QR code to fill it in for you.
  4. Wait until Blujay shows you as verified.
Sending to someone who isn’t verified returns 403 CONTACT_NOT_VERIFIED.
5

Send your first message

POST /v1/chats starts a chat and sends the first message. Replace from with your Blujay number and to with your own mobile number.
Blujay answers 202 Accepted: the message is queued (delivery_status: "queued"), not yet delivered.
service is null until Blujay confirms whether the message went out as iMessage, RCS or SMS. If your request times out, send it again with the same Idempotency-Key: you get the original result back instead of a second message.
Common mistakes
  • from is one string (the display_number); to is an array, even for one recipient.
  • 202 means queued. Nothing has been delivered yet.
  • A 400 such as VALIDATION_ERROR has no data. Check status === "error" before you read data, as the samples above do.
6

Watch it get delivered

The 202 in step 5 names the message message.id and reports delivery_status: "queued"; every read, including this one and the webhooks, calls it message_id and uses status, which starts at accepted. status moves to sent, and for iMessage and RCS on to delivered and read. service shows the service that carried it. Polling is fine for a first test; in production, subscribe to webhooks instead. See Track a message.
7

Reply from your phone

Reply to the message from your phone, then list the chat’s messages:
Your reply is there as msg_def456 with status: "received".
8

Send a follow-up

Answer in the same chat with POST /v1/chats/{chat_id}/messages, using the chat_id from your first send:
Blujay answers 202 Accepted again. Now that the person has replied, follow-ups can include links, photos, files and contact cards, and run longer than 300 characters. Until a contact replies, Blujay rejects those with a 400. See Sending rules and Send messages.
9

Get replies sent to you automatically

Instead of checking for new messages, have Blujay send each reply and delivery update to your server the moment it happens. Subscribe an HTTPS address on your server:
201 Created
The response includes signing_secret, shown only this once. Save it now: you need it to check that each webhook really came from Blujay.
Reply from your phone again, and your server receives a message.received event within seconds. That is the whole loop: you sent a message, and the reply arrived back as message.received. Testing on your laptop? A tunneling tool such as ngrok gives your local server a temporary public HTTPS address. See Webhooks for the full setup and Receive messages for what inbound messages look like.
10

Build something

  • Start from a working program: the Examples page has a complete reply bot and a safe batch sender you can copy.
  • Building with an AI assistant? Build with AI has the machine-readable docs and a prompt that reviews your integration for duplicate sends, missed webhooks and leaked keys.

Next steps

Sending rules

What a message can contain before and after the contact replies.

Send messages

Follow-ups, links, media and choosing a service.

Idempotency

Retry safely without sending twice.

Errors

What each error code means and how to handle it.