curl --request POST \
--url https://api.blujay.io/v1/chats/{chat_id}/leave \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_phone_number_id": "phone_abc123"
}
'{
"status": "success",
"data": {
"chat_id": "chat_abc123",
"operation": "chat_leave",
"status": "accepted",
"from_phone_number_id": "phone_abc123"
},
"trace_id": "trc_8f2a1c0e4b7d",
"timestamp": "2026-10-14T22:00:00.000Z"
}Leave a group chat
Removes one of your Blujay numbers from an active iMessage group chat. If more than one of your numbers is in the group, set from_phone_number_id to choose which one leaves; otherwise you can send an empty body.
Errors worth handling (all 409):
LAST_PHONE_NUMBER_IN_GROUP: this is your only number in the group, so it can’t leave.GROUP_MINIMUM_PARTICIPANTS: leaving would leave the group with fewer than three members.PHONE_NUMBER_HAS_SCHEDULED_MESSAGES: the number has scheduled messages for this group.PHONE_NUMBER_HAS_MESSAGES_SENDING: the number still has messages sending in this group. Retry once they finish.
curl --request POST \
--url https://api.blujay.io/v1/chats/{chat_id}/leave \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_phone_number_id": "phone_abc123"
}
'{
"status": "success",
"data": {
"chat_id": "chat_abc123",
"operation": "chat_leave",
"status": "accepted",
"from_phone_number_id": "phone_abc123"
},
"trace_id": "trc_8f2a1c0e4b7d",
"timestamp": "2026-10-14T22:00:00.000Z"
}Authorizations
Your workspace API key, sent as Authorization: Bearer blu_.... Workspace admins can find it in the Blujay app under API.
An API key has full access to your workspace and works on every endpoint. There is no test mode: every key sends real messages and changes real data, so keep it secret and use it only from your server.
Each API key can make 600 read requests and 120 write requests per minute, plus 60 attachment requests per minute. Over a limit you get 429 RATE_LIMIT_EXCEEDED with Retry-After.
Path Parameters
^chat_[A-Za-z0-9_-]+$"chat_abc123"
Body
from_phone_number_id picks which of your numbers leaves. It is optional when only one of your numbers is in the group, and required when more than one is.
^phone_[A-Za-z0-9_-]+$"phone_abc123"
Response
The leave was accepted.
Wraps every successful response. The result is in data.
success ^trc_[A-Za-z0-9_-]+$"trc_8f2a1c0e4b7d"
"2026-10-14T17:01:00.000Z"
Show child attributes
Show child attributes
Your X-Request-ID header value, echoed back when you send one. Not included on the send responses (POST /v1/chats, POST /v1/chats/{chat_id}/messages, POST /v1/messages/{message_id}/retry); keep your own mapping from your request ID to the returned message ID there.