MessageOS
APIEvents

Submit an event

POST
/events

Submits one event from your own system. Hidden until events are enabled.

  • contact must include contactId, phoneNumber, or externalId.
  • A phone number that is not a contact creates one with no consent record.
  • conversation.idle is reserved.
  • A repeated id returns status duplicate.

Scope: events:write.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Header Parameters

Idempotency-Key?string

8 to 128 characters. The same key and body return the stored response.

Length8 <= length <= 128

Request Body

application/json
  1. body
id?string
Lengthlength <= 128
occurredAt?string
Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
contact*
type*string
Match^[a-z][a-z0-9_.-]{1,63}$
data?
Default{}

Response Body

The event was accepted.

application/json
  1. response
id*string
status*string
Value in"received""duplicate"

Example request

curl -X POST 'https://api.messageos.ai/v1/events' \  -H 'Authorization: Bearer mosc_...' \  -H 'Idempotency-Key: visit-reminder-42-2026-10-28' \  -H 'Content-Type: application/json' \  -d '{  "id": "client-event-1",  "occurredAt": "2026-10-28T23:00:00.000Z",  "contact": {    "phoneNumber": "+15555550123"  },  "type": "lead.created",  "data": {    "leadId": "L-1",    "source": "web"  }}'

Example response

{  "id": "evt_6d1e0f3a-2c4b-4f8e-9a7d-1b2c3d4e5f60",  "status": "received"}