ComRaidComRaid Docs
API referenceMessages

Update a Draft

Edits a Message in `draft` status. Requires the `updated_at` loaded from GET (optimistic concurrency); a stale value returns 409. Non-draft Messages return 409.

PATCH
/messages/{id}

Edits a Message in draft status. Requires the updated_at loaded from GET (optimistic concurrency); a stale value returns 409. Non-draft Messages return 409.

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Project API key (cr_sk_...)

Path Parameters

id*string
Formatuuid

Request Body

application/json
  1. body

Draft edit body. updated_at must match the value from GET (409 when stale). Same Draft shape rules as create with draft: true.

updated_at*string

Optimistic concurrency token from the loaded Draft.

Formatdate-time
channel?"push"
Value in"push"
targeting?

Broadcast targeting selector for message create. Exactly one of everyone, segment_id, or rules is required. External user ID lists belong on to.external_user_ids (Single send), not here. Does not include preview-only fields such as platforms.

everyone is the Everyone selector (Contacts with at least one Active Endpoint on the Message's Channel who are not Opted out). Built-in Segments use string IDs (seg_sys_*); saved Segments use UUIDs. Glossary names for builtins: Everyone, New contacts, Recently active, Engaged, Dormant, Android contacts, iOS contacts.

category?string
type?string
name?string
priority?string
Value in"high""normal"
ttl?integer
Range0 <= value <= 2419200
collapse_key?string
Lengthlength <= 64
data?
send_at?|
Formatdate-time
send_at_local?string|null
content*

Response Body

Updated Draft

application/json
  1. response
message_id?string
Formatuuid
campaign_id?|

Present when this Message was created by a Multi-send Campaign; null for Single send and Broadcast.

Formatuuid
status?string
Value in"draft""scheduled""preparing""processing""completed""failed""cancelled"
status_summary?

Per-Message Delivery rollups. Counts nest: sent is every Delivery the Provider accepted (sent_at set, or status sent/delivered/opened), including ones later delivered or opened; delivered is part of sent and opened is part of delivered. failed and skipped are separate end states; queued and processing are in-flight. total is the Delivery row count. delivered uses received_at (API delivered_at) or opened_at, so an open without a prior delivered ACK still counts as reached. ctr is opened ÷ delivered (0 when delivered is 0) and never exceeds 100%. android and ios repeat the same nested counts split by the Delivery's Endpoint platform (one grouped query). failure_reasons counts failed Deliveries by error_code (unknown when missing). Time-series charts and per-attempt history are out of V1 for this summary.

recipient?|null
channel?string
message?
targeting?|null
timing?
attribution?
Example Request
curl -X PATCH 'https://api.comraid.io/messages/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "updated_at": "2019-08-24T14:15:22Z",  "content": {    "push": {}  }}'
Example Response
{  "message_id": "d7d9d9fd-478f-40e6-b651-49b7f19878a2",  "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904",  "status": "draft",  "status_summary": {    "status": "string",    "humanized_status": "string",    "queued": 0,    "processing": 0,    "sent": 0,    "delivered": 0,    "opened": 0,    "failed": 0,    "skipped": 0,    "remaining": 0,    "total": 0,    "ctr": 0.1,    "android": {      "queued": 0,      "processing": 0,      "sent": 0,      "delivered": 0,      "opened": 0,      "failed": 0,      "skipped": 0,      "remaining": 0,      "total": 0,      "ctr": 0.1    },    "ios": {      "queued": 0,      "processing": 0,      "sent": 0,      "delivered": 0,      "opened": 0,      "failed": 0,      "skipped": 0,      "remaining": 0,      "total": 0,      "ctr": 0.1    },    "failure_reasons": {      "property1": 0,      "property2": 0    },    "action_clicks": {      "property1": 0,      "property2": 0    }  },  "recipient": {},  "channel": "string",  "message": {},  "targeting": {},  "timing": {},  "attribution": {}}