MessageOS
APIMessagesDrafts

Create a draft

POST
/messages/drafts

Stores text for later approval. It does not send. Hidden until craft mode is enabled. With inReplyTo, the draft answers that message, and it is sent as a reply only if it is approved while the message is still within the reply window. Scope: messages:write.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Request Body

application/json
  1. body
contactId*integer
Range1 <= value <= 2147483647
text*string
Length1 <= length <= 2000
inReplyTo?integer

The id of the message from this contact that this send answers: inboundMessageId in the reply.received event, or the id of an inbound message in the conversation. When that message arrived within the reply window (an hour, shown by GET /whoami as replyWindowSeconds), the send is a reply: it needs no consent record, and quiet hours do not hold it. Up to three sends can answer one message this way, and a promotional send never counts as a reply. Where replies are not turned on, replyWindowSeconds is null and a body with inReplyTo returns 422.

Range1 <= value <= 2147483647

Response Body

The draft.

application/json
  1. response
id*integer

The draft id.

status*string
text*string
expiresAt*string

24 hours after the draft was created.

Formatdate-time

Example request

curl -X POST 'https://api.messageos.ai/v1/messages/drafts' \  -H 'Authorization: Bearer mosc_...' \  -H 'Content-Type: application/json' \  -d '{  "contactId": 42,  "text": "Hi Pat, this is a reminder about your visit on Tuesday at 3:00 PM."}'

Example response

{  "id": 15,  "status": "pending_approval",  "text": "Hi Pat, this is a reminder about your visit on Tuesday at 3:00 PM.",  "expiresAt": "2026-10-28T23:00:00.000Z"}