Skip to content

Message

A Message is one communication from any party over one medium, such as email, SMS, or chat, inbound or outbound.

Properties

PropertyTypeRequiredDescription
mediumstringrequiredOne of email, sms, voice, or chat.
directionstringrequiredOne of inbound or outbound.
bodytextrequiredWhat it says.
fromstringThe sender: an address, a number, or a Channel id.
tostringThe recipient: an address, a number, or a Person id.
subjectstringThe subject line, for email.
purposestringWhy it goes out, such as onboarding; consent and suppression rules read it.

Object

JSON
{
  "$id": "https://api.sb/routewise.dev/messages/message_1",
  "$type": "Message",
  "medium": "email",
  "direction": "inbound",
  "body": "Example body",
  "from": "Example from",
  "to": "Example to",
  "subject": "Example subject",
  "purpose": "Example purpose"
}

Relationships

  • A Message is posted in one Channel: every Message flows through one Channel. postedIn, inverse messages.
  • A Message is scheduled by one Sequence: a Sequence sends Messages, each at its own step and wait. scheduledBy, inverse schedules.
  • A Message is screened by many Guards: Guards check every outbound Message before it goes out. screenedBy, inverse screens.
  • A Message has one Thread: a Thread groups Messages that reply to one another. thread, inverse groups.

Verbs

  1. createCreates a Message.
    POST /{namespace}/messagesdoMessage.created
  2. getReturns one Message by id.
    GET /{namespace}/messages/{id}readNo Event
  3. listReturns Messages, newest first, one page at a time.
    GET /{namespace}/messagesreadNo Event
  4. updateChanges the given properties of a Message.
    PATCH /{namespace}/messages/{id}doMessage.updated
  5. deleteDeletes a Message; its history is kept.
    DELETE /{namespace}/messages/{id}doMessage.deleted
  6. broadcastBroadcast sends one Message to an Audience, now or at a set time, split by Variant when an Experiment runs.
    POST /{namespace}/messages/{message}/broadcastdoMessage.broadcasted
  7. scheduleSchedule holds a Message until a set time and sends it then, unless it is canceled first.
    POST /{namespace}/messages/{message}/scheduledoMessage.scheduled

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Message.createYesYesYesNo
Message.getYesYesYesYes
Message.listYesYesYesYes
Message.updateYesYesYesNo
Message.deleteYesYesYesNo
Message.broadcastYesNoNoNo
Message.scheduleYesYesYesNo

Call it

Text
Broadcast the latest message with an audience.

Example

A text from a parent asking to move tomorrow's tutoring session is one inbound Message. The tutor's reply in the same Thread is another, outbound.