MessageOS
APIMessagesDraftsIdApprove

Approve and send a draft

POST
/messages/drafts/{id}/approve

Sends the draft once, under the same rules as any other send. Approving again returns 409. A draft that expired cannot be approved. Scope: messages:write.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Path Parameters

id*integer

The draft id.

Range0 < value

Response Body

The draft was sent.

application/json
  1. response
id*integer

The draft id.

status*string

captured means the draft was written in a MessageOS test session. Nothing was delivered, and the draft stays pending.

Value in"sent""captured"
text*string
auditId*integer

The send record. message.delivered and message.failed carry the same number as messageId.

Example request

curl -X POST 'https://api.messageos.ai/v1/messages/drafts/42/approve' \  -H 'Authorization: Bearer mosc_...'

Example response

{  "id": 15,  "status": "sent",  "text": "Hi Pat, this is a reminder about your visit on Tuesday at 3:00 PM.",  "auditId": 123}