A single object
When you fetch one thing, you get that thing back with anobject field naming its
type:
object field is always present, and it always names the type: message, thread,
domain, inbox, webhook, api_key, template, audience, audience_member,
contact, contact_handle, agent, event, and so on. Branch on object whenever you
handle a value whose type you do not already know.
The type name is channel-neutral. An inbound reply, an outbound send, and an internal
agent-to-agent hop are all object: "message"; the channel field
says how each one traveled.
A list
Every collection uses one shape:object: "list", the items under data, and a
pagination block. This holds for a full collection, a filtered result, a single item,
or an empty result.
data is a full object with its own object field. The pagination block
carries nextCursor (a string, or null on the last page) and hasMore (a boolean).
Smaller collections that fit in one response return nextCursor: null and
hasMore: false. To walk a large list, see Pagination.
Objects that carry a nested collection
A few detail endpoints return the base object plus a related collection, inlined as a field. It is still one object with oneobject field:
- A thread detail carries its
messages. - A template detail carries the resolved
version. - An audience detail (
GET /v1/audiences/{id}) carries itsmembers, each anobject: "audience_member". - A contact detail carries its
handles, each anobject: "contact_handle".
GET /v1/messages/{id}/events rather than inline on the message.
Create responses and one-time secrets
A create returns the new object flat, with itsobject discriminator, at 201. When the
create mints a secret, the secret rides on the object as a field, alongside
secretShownOnce: true:
signingSecret
(whsec_…), an API key returns its secret (dairo_live_… or dairo_test_…). The value
is shown once, at creation, and never returned again. Capture it immediately.
Status codes and deletes
The response shape pairs with predictable HTTP status codes:
A message send returns
200, whether it goes out immediately or is scheduled;
broadcasting to an audience returns 202, since Dairo expands and delivers it in the
background. Most deletes return 200 with { "deleted": true }, and some also echo the
removed id. Deleting a domain or a share link returns 204 with no body.
Errors
Errors use their own shape,{ "error": { "type", "code", "message", "param" } },
covered in full on the Errors page.