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.
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.Check that the key works
Pick a phone number to send from
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.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.
- In Blujay, go to Contacts and choose Add verified contact.
- Enter your own mobile number and name.
- From your phone, text the message Blujay shows to your Free Plan number. Scan the QR code to fill it in for you.
- Wait until Blujay shows you as verified.
403 CONTACT_NOT_VERIFIED.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.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.Watch it get delivered
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.Send a follow-up
Answer in the same chat with Blujay answers
POST /v1/chats/{chat_id}/messages, using the chat_id from your first send: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.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:Reply from your phone again, and your server receives a
201 Created
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.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.