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}.
| Field | Type | Notes |
|---|---|---|
id | integer | |
phoneNumber | string | E.164 phone number. |
externalId | string or null | Your own id for this person. |
displayName | string or null | |
timezone | string or null | IANA time zone. Quiet hours use it first, then the client time zone. |
attributes | object | Fields this client defined for its contacts. |
optedIn | boolean | false after the person opts out. Only a message from the person changes it. |
consent | object | |
consent.source | string or null | Where consent was captured. |
consent.capturedAt | string (date-time) or null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) | |
lastInboundAt | string (date-time) or null | When the person last sent a message. |
lastOutboundAt | string (date-time) or null |
ContactWriteResult
Returned by POST /v1/contacts.
| Field | Type | Notes |
|---|---|---|
id | integer | |
phoneNumber | string | The number as stored, in E.164. |
optedIn | boolean | true for a new contact. An existing contact keeps its opt-in state. |
attributes | object | The stored attributes after this write. |
Conversation
One thread with a contact. A new one starts after the idle gap. Returned by GET /v1/conversations.
| Field | Type | Notes |
|---|---|---|
id | integer | |
contactId | integer | |
status | one of open, closed | |
channel | string | |
startedAt | string (date-time) | |
lastMessageAt | string (date-time) | |
closedAt | string (date-time) or null | |
closedReason | string or null | idle, completed, opt_out, or manual. null while open. |
startedBy | one of inbound, outbound | |
messageCount | integer |
ConversationDetail
A conversation read by id. Returned by GET /v1/conversations/{id}.
| Field | Type | Notes |
|---|---|---|
id | integer | |
contactId | integer | |
status | one of open, closed | |
channel | string | |
startedAt | string (date-time) | |
lastMessageAt | string (date-time) | |
closedAt | string (date-time) or null | |
closedReason | string or null | idle, completed, opt_out, or manual. null while open. |
startedBy | one of inbound, outbound | |
messageCount | integer | |
clientId | string | The 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.
| Field | Type | Notes |
|---|---|---|
id | integer | |
direction | one of inbound, outbound | |
text | string | The 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. |
kind | one of text, card, carousel, media, message | What kind of message it is. media is a file: the send that made it answered with type file. |
chips | array of object | Suggested reply labels sent with the message. |
chips[].label | string | |
channel | string or null | |
status | one of sent, delivered, read, failed or null | The latest delivery report. null when there is none. |
origin | one of agent, api, dashboard, job, event, system or null | Who sent an outbound message. null for an inbound message, or when it is not known. |
createdAt | string (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}.
| Field | Type | Notes |
|---|---|---|
id | string | msg_ followed by auditId. |
auditId | integer | The send record. message.delivered and message.failed carry the same number as messageId. |
status | one of sending, sent, delivered, read, failed, blocked, deferred | sent 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. |
statusAt | string (date-time) | When the message reached this status. |
reason | string or null | Why 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. |
type | one of text, card, carousel, file or null | What the request asked to send. null for a message sent before this field existed. |
class | string | |
channel | string or null | |
contactId | integer or null | |
reference | string or null | The reference you sent with the message, or null. |
origin | one of agent, api, dashboard, job, event, system | Who sent it. api is a send through this API. |
createdAt | string (date-time) |
Capabilities
Whether one phone can receive RCS from this agent, and what it supports. Returned by GET /v1/capabilities.
| Field | Type | Notes |
|---|---|---|
phoneNumber | string | The number that was checked, in E.164. |
rcs | boolean | true 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. |
features | array of one of card, carousel, openUrl, dial, viewLocation, shareLocation, createCalendarEvent, revoke | What 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}.
| Field | Type | Notes |
|---|---|---|
id | integer | The draft id. |
contactId | integer | |
status | one of pending_approval, approved, sent, discarded, expired, blocked | |
text | string | |
messageClass | string | |
expiresAt | string (date-time) | 24 hours after the draft was created. |
auditId | integer or null | The send record, once the draft was sent or blocked. |
WebhookEndpoint
An https address that receives signed events. Returned by GET /v1/webhooks.
| Field | Type | Notes |
|---|---|---|
id | integer | |
url | string | |
eventTypes | array of one of message.delivered, message.failed, message.read, reply.received, contact.opted_out, contact.opted_in, workflow.completed | |
status | one of active, paused, disabled | paused after repeated dead deliveries. disabled after DELETE, a 410 response, or a PATCH to disabled. An endpoint removed with DELETE cannot be changed again. |
createdAt | string (date-time) |
WebhookDelivery
One event queued for one endpoint. The payload is not included. Returned by GET /v1/webhooks/{id}/deliveries.
| Field | Type | Notes |
|---|---|---|
id | integer | |
eventId | string | |
type | string | |
status | one of pending, delivered, failed, dead | |
attempts | integer | |
lastStatusCode | integer or null | The HTTP status of the last attempt. |
createdAt | string (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.
| Field | Type | Notes |
|---|---|---|
id | integer | |
question | string | |
answer | string | |
tags | array of string | |
verbatim | boolean | When true the assistant sends the answer word for word. |
status | one of draft, approved, archived | |
source | one of seed, api, dashboard, gap, website, assistant | |
version | integer | Goes up by one with each edit. |
approvedBy | string or null |
UsageDay
Counts for one day. It is a measurement, not a charge. Returned by GET /v1/usage.
| Field | Type | Notes |
|---|---|---|
day | string | |
conversations | integer | |
inboundMessages | integer | |
outboundRcs | integer | |
outboundSms | integer | |
estCostMicroUsd | integer or null | null until a rate card is configured. |
gapsRecorded | integer | |
toolCalls | integer | |
workflowsCompleted | integer |
UsageSummary
Delivery and consent totals for a range of days. It is a measurement, not a charge. Returned by GET /v1/usage/summary.
| Field | Type | Notes |
|---|---|---|
from | string | First day, included. |
to | string | End day, not included. |
timeZone | "UTC" | |
totals | object | |
totals.sent | integer | Messages 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.delivered | integer | Sent messages with a delivered or a read report. |
totals.read | integer | Sent messages with a read report. A phone with read receipts off never reports one. |
totals.failed | integer | Sent messages with a failed report. |
totals.optedOut | integer | Times 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.optedIn | integer | Times 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. |
rates | object | |
rates.delivered | number or null | A share from 0 to 1 of the messages sent. null when there are none. |
rates.read | number or null | A share from 0 to 1 of the messages delivered. null when there are none. |
rates.failed | number or null | A share from 0 to 1 of the messages sent. null when there are none. |
days | array of object | One row for every day of the range, with zeros on a day with nothing. |
days[].day | string | |
days[].sent | integer | Messages 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[].delivered | integer | Sent messages with a delivered or a read report. |
days[].read | integer | Sent messages with a read report. A phone with read receipts off never reports one. |
days[].failed | integer | Sent messages with a failed report. |
days[].optedOut | integer | Times 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[].optedIn | integer | Times 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. |
failureReasons | array of object | Why messages failed, most common first, up to five. |
failureReasons[].reason | string | The messaging network's own words for the failure. They are not a fixed list and can change. |
failureReasons[].count | integer |
Gap
A moment the assistant could not help, kept for review. Returned by GET /v1/gaps.
| Field | Type | Notes |
|---|---|---|
id | integer | |
reason | string | |
reasonDetail | string or null | |
category | string or null | |
groupKey | string | |
summary | string or null | null when the client policy omits summaries. |
toolName | string or null | |
status | one of open, reviewed, dismissed | |
createdAt | string (date-time) |
Error
Every error uses this body. The Errors page lists the codes.
| Field | Type | Notes |
|---|---|---|
error | object | |
error.code | string | A stable code from the Errors page. |
error.message | string | A short sentence for people. It can change. |
error.requestId | string | Quote it when you report a problem. |
error.reason | string | Only with blocked: the stable reason the message was not sent, from the Errors page. message says the same in a sentence. Optional. |
error.details | array of object | Field problems. For blocked, details[0].message repeats reason. Optional. |
error.details[].path | string | |
error.details[].message | string |
