Message
A Message is one communication from any party over one medium, such as email, SMS, or chat, inbound or outbound.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
medium | string | required | One of email, sms, voice, or chat. |
direction | string | required | One of inbound or outbound. |
body | text | required | What it says. |
from | string | The sender: an address, a number, or a Channel id. | |
to | string | The recipient: an address, a number, or a Person id. | |
subject | string | The subject line, for email. | |
purpose | string | Why it goes out, such as onboarding; consent and suppression rules read it. |
Object
{
"$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, inversemessages. - A Message is scheduled by one Sequence: a Sequence sends Messages, each at its own step and wait.
scheduledBy, inverseschedules. - A Message is screened by many Guards: Guards check every outbound Message before it goes out.
screenedBy, inversescreens. - A Message has one Thread: a Thread groups Messages that reply to one another.
thread, inversegroups.
Verbs
createCreates a Message.POST /{namespace}/messagesgetReturns one Message by id.GET /{namespace}/messages/{id}listReturns Messages, newest first, one page at a time.GET /{namespace}/messagesupdateChanges the given properties of a Message.PATCH /{namespace}/messages/{id}deleteDeletes a Message; its history is kept.DELETE /{namespace}/messages/{id}broadcastBroadcast sends one Message to an Audience, now or at a set time, split by Variant when an Experiment runs.POST /{namespace}/messages/{message}/broadcastscheduleSchedule holds a Message until a set time and sends it then, unless it is canceled first.POST /{namespace}/messages/{message}/schedule
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Message.create | Yes | Yes | Yes | No |
Message.get | Yes | Yes | Yes | Yes |
Message.list | Yes | Yes | Yes | Yes |
Message.update | Yes | Yes | Yes | No |
Message.delete | Yes | Yes | Yes | No |
Message.broadcast | Yes | No | No | No |
Message.schedule | Yes | Yes | Yes | No |
Call it
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.