MessageOS
API

Objects

The fields of each object the API returns.

Times are ISO 8601 strings. A field that is not marked optional is always present, and can be null when its type says so. New fields can be added to an object, so ignore fields you do not know.

Contact

A person this client can message. A contact is unique per phone number. Returned by GET /v1/contacts and GET /v1/contacts/{id}.

FieldTypeNotes
idinteger
phoneNumberstringE.164 phone number.
externalIdstring or nullYour own id for this person.
displayNamestring or null
timezonestring or nullIANA time zone. Quiet hours use it first, then the client time zone.
attributesobjectFields this client defined for its contacts.
optedInbooleanfalse after the person opts out. Only a message from the person changes it.
consentobject
consent.sourcestring or nullWhere consent was captured.
consent.capturedAtstring (date-time) or null
createdAtstring (date-time)
updatedAtstring (date-time)
lastInboundAtstring (date-time) or nullWhen the person last sent a message.
lastOutboundAtstring (date-time) or null

ContactWriteResult

Returned by POST /v1/contacts.

FieldTypeNotes
idinteger
phoneNumberstringThe number as stored, in E.164.
optedInbooleantrue for a new contact. An existing contact keeps its opt-in state.
attributesobjectThe stored attributes after this write.

Conversation

One thread with a contact. A new one starts after the idle gap. Returned by GET /v1/conversations.

FieldTypeNotes
idinteger
contactIdinteger
statusone of open, closed
channelstring
startedAtstring (date-time)
lastMessageAtstring (date-time)
closedAtstring (date-time) or null
closedReasonstring or nullidle, completed, opt_out, or manual. null while open.
startedByone of inbound, outbound
messageCountinteger

ConversationDetail

A conversation read by id. Returned by GET /v1/conversations/{id}.

FieldTypeNotes
idinteger
contactIdinteger
statusone of open, closed
channelstring
startedAtstring (date-time)
lastMessageAtstring (date-time)
closedAtstring (date-time) or null
closedReasonstring or nullidle, completed, opt_out, or manual. null while open.
startedByone of inbound, outbound
messageCountinteger
clientIdstringThe client that owns the conversation. The list does not include it.

Message

One message in a conversation. Provider identifiers are not included. Returned by GET /v1/conversations/{id}/messages.

FieldTypeNotes
idinteger
directionone of inbound, outbound
textstringThe words of the message. For an inbound message it is what the person typed, or the label of the suggestion they tapped, the same as text in reply.received. It is empty for a file or a location sent with no words.
kindone of text, card, carousel, media, messageWhat kind of message it is. media is a file: the send that made it answered with type file.
chipsarray of objectSuggested reply labels sent with the message.
chips[].labelstring
channelstring or null
statusone of sent, delivered, read, failed or nullThe latest delivery report. null when there is none.
originone of agent, api, dashboard, job, event, system or nullWho sent an outbound message. null for an inbound message, or when it is not known.
createdAtstring (date-time)

SentMessage

One message this agent sent, or tried to send, and where it stands. Provider identifiers are not included. Returned by GET /v1/messages/{id}.

FieldTypeNotes
idstringmsg_ followed by auditId.
auditIdintegerThe send record. message.delivered and message.failed carry the same number as messageId.
statusone of sending, sent, delivered, read, failed, blocked, deferredsent means the messaging network took the message. delivered and read come from the phone. failed means it did not arrive, or, with the reason provider_error, that MessageOS could not confirm it was sent, so it may still have gone out. blocked and deferred mean nothing was sent. sending means the send has not finished.
statusAtstring (date-time)When the message reached this status.
reasonstring or nullWhy a blocked message was not sent: one of the blocked reasons. For a failed one, the messaging network's own words for why, as in message.failed, which are not a fixed list and can change, or provider_error when MessageOS could not confirm the message was sent. null otherwise.
typeone of text, card, carousel, file or nullWhat the request asked to send. null for a message sent before this field existed.
classstring
channelstring or null
contactIdinteger or null
referencestring or nullThe reference you sent with the message, or null.
originone of agent, api, dashboard, job, event, systemWho sent it. api is a send through this API.
createdAtstring (date-time)

Capabilities

Whether one phone can receive RCS from this agent, and what it supports. Returned by GET /v1/capabilities.

FieldTypeNotes
phoneNumberstringThe number that was checked, in E.164.
rcsbooleantrue when this phone can receive RCS from this agent. false when the messaging network says it cannot. For an agent that has not launched, that is also the answer for a phone that is not one of its testers.
featuresarray of one of card, carousel, openUrl, dial, viewLocation, shareLocation, createCalendarEvent, revokeWhat this phone supports, in the names this API uses: card and carousel are the message types, openUrl, dial, viewLocation, shareLocation, and createCalendarEvent are the suggested actions, and revoke means the phone allows a message to be taken back after it is delivered and before it is read. Empty when rcs is false.

Draft

Text waiting for approval. Approving it sends it once. Returned by GET /v1/messages/drafts/{id}.

FieldTypeNotes
idintegerThe draft id.
contactIdinteger
statusone of pending_approval, approved, sent, discarded, expired, blocked
textstring
messageClassstring
expiresAtstring (date-time)24 hours after the draft was created.
auditIdinteger or nullThe send record, once the draft was sent or blocked.

WebhookEndpoint

An https address that receives signed events. Returned by GET /v1/webhooks.

FieldTypeNotes
idinteger
urlstring
eventTypesarray of one of message.delivered, message.failed, message.read, reply.received, contact.opted_out, contact.opted_in, workflow.completed
statusone of active, paused, disabledpaused after repeated dead deliveries. disabled after DELETE, a 410 response, or a PATCH to disabled. An endpoint removed with DELETE cannot be changed again.
createdAtstring (date-time)

WebhookDelivery

One event queued for one endpoint. The payload is not included. Returned by GET /v1/webhooks/{id}/deliveries.

FieldTypeNotes
idinteger
eventIdstring
typestring
statusone of pending, delivered, failed, dead
attemptsinteger
lastStatusCodeinteger or nullThe HTTP status of the last attempt.
createdAtstring (date-time)

KnowledgeEntry

An approved answer, or a draft of one. The assistant uses approved entries only. Returned by the /v1/knowledge endpoints, inside entries or entry.

FieldTypeNotes
idinteger
questionstring
answerstring
tagsarray of string
verbatimbooleanWhen true the assistant sends the answer word for word.
statusone of draft, approved, archived
sourceone of seed, api, dashboard, gap, website, assistant
versionintegerGoes up by one with each edit.
approvedBystring or null

UsageDay

Counts for one day. It is a measurement, not a charge. Returned by GET /v1/usage.

FieldTypeNotes
daystring
conversationsinteger
inboundMessagesinteger
outboundRcsinteger
outboundSmsinteger
estCostMicroUsdinteger or nullnull until a rate card is configured.
gapsRecordedinteger
toolCallsinteger
workflowsCompletedinteger

UsageSummary

Delivery and consent totals for a range of days. It is a measurement, not a charge. Returned by GET /v1/usage/summary.

FieldTypeNotes
fromstringFirst day, included.
tostringEnd day, not included.
timeZone"UTC"
totalsobject
totals.sentintegerMessages sent to the messaging network, each counted once, on the day it was sent. A message sent again after the network rejected a test phone is one message.
totals.deliveredintegerSent messages with a delivered or a read report.
totals.readintegerSent messages with a read report. A phone with read receipts off never reports one.
totals.failedintegerSent messages with a failed report.
totals.optedOutintegerTimes a contact sent an opt-out word such as STOP, or unsubscribed from their messaging app. The same one repeated within two minutes is counted once. It is a count of messages, not of contacts.
totals.optedInintegerTimes a contact sent an opt-in word such as START, or subscribed from their messaging app. The same one repeated within two minutes is counted once. It is a count of messages, not of contacts.
ratesobject
rates.deliverednumber or nullA share from 0 to 1 of the messages sent. null when there are none.
rates.readnumber or nullA share from 0 to 1 of the messages delivered. null when there are none.
rates.failednumber or nullA share from 0 to 1 of the messages sent. null when there are none.
daysarray of objectOne row for every day of the range, with zeros on a day with nothing.
days[].daystring
days[].sentintegerMessages sent to the messaging network, each counted once, on the day it was sent. A message sent again after the network rejected a test phone is one message.
days[].deliveredintegerSent messages with a delivered or a read report.
days[].readintegerSent messages with a read report. A phone with read receipts off never reports one.
days[].failedintegerSent messages with a failed report.
days[].optedOutintegerTimes a contact sent an opt-out word such as STOP, or unsubscribed from their messaging app. The same one repeated within two minutes is counted once. It is a count of messages, not of contacts.
days[].optedInintegerTimes a contact sent an opt-in word such as START, or subscribed from their messaging app. The same one repeated within two minutes is counted once. It is a count of messages, not of contacts.
failureReasonsarray of objectWhy messages failed, most common first, up to five.
failureReasons[].reasonstringThe messaging network's own words for the failure. They are not a fixed list and can change.
failureReasons[].countinteger

Gap

A moment the assistant could not help, kept for review. Returned by GET /v1/gaps.

FieldTypeNotes
idinteger
reasonstring
reasonDetailstring or null
categorystring or null
groupKeystring
summarystring or nullnull when the client policy omits summaries.
toolNamestring or null
statusone of open, reviewed, dismissed
createdAtstring (date-time)

Error

Every error uses this body. The Errors page lists the codes.

FieldTypeNotes
errorobject
error.codestringA stable code from the Errors page.
error.messagestringA short sentence for people. It can change.
error.requestIdstringQuote it when you report a problem.
error.reasonstringOnly with blocked: the stable reason the message was not sent, from the Errors page. message says the same in a sentence. Optional.
error.detailsarray of objectField problems. For blocked, details[0].message repeats reason. Optional.
error.details[].pathstring
error.details[].messagestring

On this page