Natzar Partner API Reference - v1.0.0
    Preparing search index...

    Interface MessageResource

    ONE message — the single message shape this API uses everywhere.

    The same object is returned by the agent conversation (GET /v1/agent/messages), by an async consult transcript (GET /v1/async-consults/{id}/messages), and inside message webhooks. A client writes ONE renderer and reuses it for chat, consult threads, and event replay.

    What differs between those surfaces is only which fields can appear:

    agent conversation consult transcript
    author: 'agent' yes never (a consult is a human thread)
    asyncConsultId on escalated turns only always, and equal to that consult
    classification on lifecycle notices on lifecycle notices

    Transcripts are COMPLETE: patient turns, agent turns, physician replies and every system-generated lifecycle notice appear in order, so rendering the list verbatim always produces an honest history.

    interface MessageResource {
        id: string;
        author: MessageAuthor;
        body: string;
        emergency?: boolean;
        asyncConsultId?: string;
        classification?:
            | "async:resolve_requested"
            | "async:escalated"
            | "async:patient_closed"
            | "async:physician_reply"
            | "async:queued_confirm"
            | "async:assigned"
            | "async:reassigned"
            | "async:queue_delay"
            | "async:still_searching"
            | "async:no_capacity_closed"
            | "async:closed_resolved"
            | "async:cancelled_closed"
            | "async:declined_closed"
            | "async:inactivity_warning"
            | "async:inactivity_closed"
            | "async:awaiting_ack";
        clientRef?: string;
        signature?: string;
        attachments?: AttachmentResource[];
        sentAt: string;
    }
    Index
    id: string

    Stable message id (also the idempotency key you'll see in webhooks).

    Who wrote it.

    body: string

    The message text, in the patient's language. For system notices this is the localized copy — exactly what our own surfaces show.

    emergency?: boolean

    True when this is the deterministic EMERGENCY safety response (the "call 911/988" line) rather than ordinary clinical advice. It is produced by rule, not by the model, and it is the highest-stakes message the platform sends — render it prominently and never collapse it.

    asyncConsultId?: string

    The async consult this message belongs to, when it belongs to one — the same id you pass to GET /v1/async-consults/{id}. In the agent conversation its presence is the signal that a HUMAN clinician, not the agent, owns this stretch of the conversation.

    classification?:
        | "async:resolve_requested"
        | "async:escalated"
        | "async:patient_closed"
        | "async:physician_reply"
        | "async:queued_confirm"
        | "async:assigned"
        | "async:reassigned"
        | "async:queue_delay"
        | "async:still_searching"
        | "async:no_capacity_closed"
        | "async:closed_resolved"
        | "async:cancelled_closed"
        | "async:declined_closed"
        | "async:inactivity_warning"
        | "async:inactivity_closed"
        | "async:awaiting_ack"

    Semantic tag for lifecycle-generated messages, so you can render your own chip instead of the localized body text. Absent on ordinary turns.

    clientRef?: string

    Echo of the messageId you were given when you submitted this turn, on author: 'patient' messages you sent through the API. Use it to match a message you rendered optimistically against the one that came back, so the patient never sees their own message twice.

    signature?: string

    The physician's display signature at the time of the reply (e.g. "Dr. Jane Doe, MD"), frozen per message. Present only on author: 'physician' messages — render it as the sender line the same way our own surfaces do.

    attachments?: AttachmentResource[]

    Attachments, if any.

    sentAt: string

    When the message was recorded.