---
title: "Edit chat message"
method: PATCH
path: "/chats/{chat_id}/messages/{message_id}"
tags: ["Messages"]
---

# Edit chat message

`PATCH /chats/{chat_id}/messages/{message_id}`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/chats/{chat_id}/messages/{message_id}`
- Auth: HTTP bearer

Edit the text content of a specific message.

## Path parameters

- `chat_id` string, required
- `message_id` string, required

## Request body

- UpdateChatMessageSchema: Edit the content of a message
  - `message` ModelUserPartsSchema[], required: The user message to open the chat with
    - union: User message parts
      - ModelTextPartSchema
        - `type` 'text', required
        - `text` string, required
        - `audio` FileSchema: Detailed information about a file
          - `id` string, required: Unique identifier for the file
          - `file_path` string, required: Path to the file in the storage system
          - `file_filename` string, required: Name of the file
          - `file_size` number, required: Size of the file in bytes
          - `file_mimetype` string, required: MIME type of the file
          - `file_url` string, required: URL to access the file
          - `created_at` string, date-time, nullable, required: Timestamp when the file was created
        - `start_ms` integer: Where the spoken text starts on the voice call timeline, in ms from the call start
        - `end_ms` integer: Where the spoken text ends on the voice call timeline, in ms from the call start
        - `html` boolean: When true, text holds the raw original inbound email HTML, stored verbatim. Clients sanitize and render it; the model receives markdown derived at read time.
        - `json` boolean: When true, text holds a JSON document, such as a trigger payload. Clients render it as JSON; the model receives the text as-is.
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelUserFilePartSchema: A file sent in a message. The server writes its transcript and description.
        - `type` 'file', required
        - `url` string, required
        - `kind` 'voice' | 'sticker': Marks communication-only files (voice notes, stickers) from integrations so they can be excluded from the contact files tab.
        - `file` FileSchema: Detailed information about a file
          - `id` string, required: Unique identifier for the file
          - `file_path` string, required: Path to the file in the storage system
          - `file_filename` string, required: Name of the file
          - `file_size` number, required: Size of the file in bytes
          - `file_mimetype` string, required: MIME type of the file
          - `file_url` string, required: URL to access the file
          - `created_at` string, date-time, nullable, required: Timestamp when the file was created
        - `auto_consume` boolean: Whether this file should be automatically consumed and processed by the model
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelImagePartSchema
        - `type` 'image', required
        - `url` string, required
        - `kind` 'voice' | 'sticker': Marks communication-only files (voice notes, stickers) from integrations so they can be excluded from the contact files tab.
        - `file` FileSchema: Detailed information about a file
          - `id` string, required: Unique identifier for the file
          - `file_path` string, required: Path to the file in the storage system
          - `file_filename` string, required: Name of the file
          - `file_size` number, required: Size of the file in bytes
          - `file_mimetype` string, required: MIME type of the file
          - `file_url` string, required: URL to access the file
          - `created_at` string, date-time, nullable, required: Timestamp when the file was created
        - `auto_consume` boolean: Whether this file should be automatically consumed and processed by the model
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelOptionSelectedPartSchema: Option selected by the user, typically used in multiple choice scenarios
        - `type` 'option_selected', required
        - `call_id` string: The ID of the tool call that generated the options
        - `label` string, required: Label for the option selected
        - `value` string, required: Value for the option selected
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelContactPartSchema
        - `type` 'contact', required
        - `name` string
        - `email` string
        - `phone` string
        - `username` string
        - `user_id` string: Id of the person on the channel the message came from
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelLocationPartSchema
        - `type` 'location', required
        - `latitude` number
        - `longitude` number
        - `name` string
        - `address` string
        - `url` string
        - `google_place_id` string
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelReferencePartSchema: An entity the user tagged in the message. Validated and enriched server-side on send; org chats only.
        - `type` 'reference', required
        - `kind` 'agent' | 'routine' | 'contact' | 'user' | 'skill' | 'record' | 'table' | 'assistant', required: The kind of entity a reference points at
        - `id` string, required: Public id of the referenced entity
        - `name` string, required: Display name, snapshotted when the text was written
        - `icon` union: The entity's own icon or emoji, filled on write. Null = the default of its kind
          - string, emoji: The emoji of a curated icon a user can pick for a table, view, field, or other entity
          - 'TableCellsIcon' | 'DatabaseIcon' | 'DocumentTextIcon' | 'DocumentChartBarIcon' | 'ClipboardDocumentListIcon' | 'ClipboardDocumentCheckIcon' | 'FolderIcon' | 'ArchiveBoxIcon' | 'InboxIcon' | 'BookOpenIcon' | 'BookmarkIcon' | 'NewspaperIcon' | 'RectangleStackIcon' | 'PencilSquareIcon' | 'UserIcon' | 'UsersIcon' | 'UserGroupIcon' | 'UserPlusIcon' | 'IdentificationIcon' | 'FaceSmileIcon' | 'HandThumbUpIcon' | 'HeartIcon' | 'StarIcon' | 'CheckBadgeIcon' | 'TrophyIcon' | 'CrownIcon' | 'ChatBubbleLeftIcon' | 'ChatBubbleLeftRightIcon' | 'EnvelopeIcon' | 'EnvelopeOpenIcon' | 'PhoneIcon' | 'DevicePhoneMobileIcon' | 'MegaphoneIcon' | 'BellIcon' | 'PaperAirplaneIcon' | 'AtSymbolIcon' | 'RssIcon' | 'LifebuoyIcon' | 'ShoppingCartIcon' | 'ShoppingBagIcon' | 'BuildingStorefrontIcon' | 'CreditCardIcon' | 'BanknotesIcon' | 'CurrencyDollarIcon' | 'CurrencyEuroIcon' | 'ReceiptPercentIcon' | 'WalletIcon' | 'CoinsIcon' | 'GiftIcon' | 'TagIcon' | 'TicketIcon' | 'ScaleIcon' | 'TruckIcon' | 'CubeIcon' | 'CalendarIcon' | 'CalendarDaysIcon' | 'CalendarDateRangeIcon' | 'ClockIcon' | 'FlagIcon' | 'CheckCircleIcon' | 'ListBulletIcon' | 'QueueListIcon' | 'FunnelIcon' | 'ChartBarIcon' | 'ChartPieIcon' | 'PresentationChartLineIcon' | 'ArrowTrendingUpIcon' | 'BriefcaseIcon' | 'WrenchScrewdriverIcon' | 'Cog6ToothIcon' | 'KeyIcon' | 'LockClosedIcon' | 'ShieldCheckIcon' | 'BoltIcon' | 'LightBulbIcon' | 'BeakerIcon' | 'BugAntIcon' | 'CpuChipIcon' | 'CodeBracketIcon' | 'CommandLineIcon' | 'ServerIcon' | 'LinkIcon' | 'HomeIcon' | 'HomeModernIcon' | 'BuildingOfficeIcon' | 'BuildingOffice2Icon' | 'BuildingLibraryIcon' | 'MapPinIcon' | 'MapIcon' | 'GlobeAltIcon' | 'GlobeAmericasIcon' | 'RocketLaunchIcon' | 'PlaneIcon' | 'CarIcon' | 'SunIcon' | 'MoonIcon' | 'FireIcon' | 'SparklesIcon' | 'CakeIcon' | 'AcademicCapIcon' | 'ScissorsIcon' | 'SwatchIcon' | 'PaintBrushIcon' | 'CoffeeIcon' | 'UtensilsIcon' | 'LeafIcon' | 'DumbbellIcon' | 'HeartPulseIcon' | 'PawPrintIcon' | 'StethoscopeIcon' | 'CameraIcon' | 'PhotoIcon' | 'FilmIcon' | 'VideoCameraIcon' | 'MicrophoneIcon' | 'MusicalNoteIcon' | 'SpeakerWaveIcon' | 'PlayCircleIcon' | 'TvIcon' | 'RadioIcon' | 'PuzzlePieceIcon' | 'GamepadIcon': The name of a curated icon a user can pick for a table, view, field, or other entity
        - `icon_url` string, uri, nullable: The entity's image, filled on write, when it has one
        - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral' | 'null', nullable: The entity's tint, filled on write, when it has one
        - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
        - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds

## Response `200`

- ChatMessageSchema: The chat message schema
  - `id` string, required
  - `role` 'user' | 'assistant' | 'system' | 'tool' | 'event' | 'note', required: The role of the message
  - `model` string, required: The model used for the message
  - `messages` ModelMessageSchema[]: The message content
    - union
      - ModelSystemMessageSchema: System message
        - `role` 'system', required
        - `parts` ModelTextPartSchema[], required
          - `type` 'text', required
          - `text` string, required
          - `audio` FileSchema: Detailed information about a file
            - `id` string, required: Unique identifier for the file
            - `file_path` string, required: Path to the file in the storage system
            - `file_filename` string, required: Name of the file
            - `file_size` number, required: Size of the file in bytes
            - `file_mimetype` string, required: MIME type of the file
            - `file_url` string, required: URL to access the file
            - `created_at` string, date-time, nullable, required: Timestamp when the file was created
          - `start_ms` integer: Where the spoken text starts on the voice call timeline, in ms from the call start
          - `end_ms` integer: Where the spoken text ends on the voice call timeline, in ms from the call start
          - `html` boolean: When true, text holds the raw original inbound email HTML, stored verbatim. Clients sanitize and render it; the model receives markdown derived at read time.
          - `json` boolean: When true, text holds a JSON document, such as a trigger payload. Clients render it as JSON; the model receives the text as-is.
          - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
          - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelAssistantMessageSchema: Assistant message
        - `id` string: Unique identifier for the assistant message
        - `role` 'assistant', required
        - `parts` ModelAssistantMessagePartsSchema[], required
          - union: Parts of the assistant message
            - ModelTextPartSchema
              - …
            - ModelFilePartSchema
              - …
            - ModelToolCallPartSchema
              - …
            - ModelMessageReasoningSchema
              - …
            - ModelSourcePartSchema: Source URL for the message, typically used for annotations
              - …
        - `reactions` string: Prerendered emoji reactions on the message, injected at prompt build time
      - ModelUserMessageSchema: User message
        - `role` 'user', required
        - `parts` ModelUserMessagePartsSchema[], required
          - union: Parts of the user message: the user parts, plus the options or requests a business showed the contact
            - ModelTextPartSchema
              - …
            - ModelFilePartSchema
              - …
            - ModelImagePartSchema
              - …
            - ModelOptionSelectedPartSchema: Option selected by the user, typically used in multiple choice scenarios
              - …
            - ModelContactPartSchema
              - …
            - ModelLocationPartSchema
              - …
            - ModelReferencePartSchema: An entity the user tagged in the message. Validated and enriched server-side on send; org chats only.
              - …
            - ModelToolCallPartSchema
              - …
        - `name` string: Name of the user, used to give context on multiplayer chats
        - `member_role` 'customer' | 'staff' | 'agent' | 'user': Role of the message sender: customer/staff/agent for assistant chats, user for regular chats
        - `timestamp` string: Formatted timestamp for the message, used for time-awareness in conversations
        - `reactions` string: Prerendered emoji reactions on the message, injected at prompt build time
        - `message_id` string: Short reference to the stored message (the first uuid segment, 8 characters), injected at prompt build time so tools can target the message
      - ModelToolMessageSchema: Tool message
        - `id` string: Unique identifier for the assistant message
        - `role` 'tool', required
        - `parts` ModelToolResultPartSchema[], required
          - `type` 'tool_result', required
          - `id` string, required: Unique identifier for the tool call
          - `name` string, required: The name of the tool called
          - `parts` ModelResultPartResultPartsSchema[]: Parts of the tool call result
            - union: Parts of the tool call result
              - …
          - `result` unknown
          - `refresh_tools` boolean: Runtime-only signal: when true, the agent loop rebuilds its tool set before the next step (e.g. after enable_tools / disable_tools). Stripped before the result is persisted.
          - `stop` boolean: Runtime-only signal: when true, the agent loop ends after this step instead of spawning the next turn (e.g. close_conversation with stop: true). Stripped before the result is persisted.
          - `is_error` boolean: Indicates if the tool call resulted in an error
          - `timestamp` number: Timestamp of the tool call in milliseconds
          - `start_timestamp` number: Timestamp when the message part started processing, in milliseconds
          - `end_timestamp` number: Timestamp when the message part finished processing, in milliseconds
      - ModelEventMessageSchema
        - `role` 'event', required
        - `parts` ModelEventMessagePartsSchema[], required
          - union: Parts of the event message
            - ModelEventAssignmentPartSchema: Assignment event part - text generated from locales
              - …
            - ModelEventStatusChangePartSchema: Status change event part (user-visible) - text generated from locales
              - …
            - ModelEventAiStatusPartSchema: AI toggle event part - text generated from locales
              - …
            - ModelEventMuteChangePartSchema: Mute change event part
              - …
            - ModelEventHandoverPartSchema: Another app on the channel passed, took or requested the conversation (Meta handover protocol)
              - …
            - ModelEventFollowUpPartSchema: Follow-up event — AI re-engaging an inactive conversation
              - …
            - ModelEventPaymentPartSchema: Payment event — a checkout the customer completed
              - …
            - ModelEventAnalysisPartSchema: Analysis event — AI post-conversation analysis (CSAT, etc.)
              - …
            - ModelEventReferralPartSchema: Referral event — conversation initiated or resumed from an ad, post, or story
              - …
            - ModelEventApprovalDecisionPartSchema: Approval decision event — a pending action was accepted or rejected by a chat member. The decider is the owner of the parent ChatMessage.
              - …
            - ModelEventQuestionsAnsweredPartSchema: Questions answered event — a pending ask_questions call was answered by a chat member. The answerer is the owner of the parent ChatMessage.
              - …
            - ModelEventLocationSharedPartSchema: Location shared event — a pending request_location call was answered by a chat member. The sharer is the owner of the parent ChatMessage.
              - …
            - ModelEventContactUpdatePartSchema: AI updated one or more contact properties. Emitted from the update_contact tool callback or the post-conversation analysis pass.
              - …
            - ModelEventConnectionConnectedPartSchema: Connection-connected event: the user connected an app in response to request_connection.
              - …
            - ModelEventAgentRunStartedPartSchema: Run started — the first message of every run chat, recording what fired it.
              - …
            - ModelEventAgentRunFinishedPartSchema: Sub-agent run finished — posted to the chat that dispatched it, so the conversation can pick the result up.
              - …
            - ModelEventReminderPartSchema: Reminder fired — a wake-up the AI scheduled on this chat came due.
              - …
            - ModelEventMemberJoinedPartSchema: A person was added to the chat; the event owner is who added them.
              - …
            - ModelEventMemberLeftPartSchema: A person left the chat or was removed; the event owner is who did it.
              - …
            - ModelEventCallStartedPartSchema: Voice call started — the turns that follow, up to event_call_ended, are its transcript.
              - …
            - ModelEventCallEndedPartSchema: Voice call ended — closes the call event_call_started opened; the messages between the two are the call.
              - …
        - `name` string
        - `member_role` 'customer' | 'staff' | 'agent' | 'user': Role of the message sender: customer/staff/agent for assistant chats, user for regular chats
        - `timestamp` string
        - `reactions` string: Prerendered emoji reactions on the message, injected at prompt build time
        - `message_id` string: Short reference to the stored message (the first uuid segment, 8 characters), injected at prompt build time so tools can target the message
      - ModelNoteMessageSchema
        - `role` 'note', required
        - `parts` ModelUserPartsSchema[], required
          - union: User message parts
            - ModelTextPartSchema
              - …
            - ModelUserFilePartSchema: A file sent in a message. The server writes its transcript and description.
              - …
            - ModelImagePartSchema
              - …
            - ModelOptionSelectedPartSchema: Option selected by the user, typically used in multiple choice scenarios
              - …
            - ModelContactPartSchema
              - …
            - ModelLocationPartSchema
              - …
            - ModelReferencePartSchema: An entity the user tagged in the message. Validated and enriched server-side on send; org chats only.
              - …
        - `name` string: Name of the staff member who wrote the note
        - `member_role` 'customer' | 'staff' | 'agent' | 'user': Role of the message sender: customer/staff/agent for assistant chats, user for regular chats
        - `timestamp` string: Formatted timestamp for the note, used for time-awareness in conversations
  - `member` ChatMemberSchema: The member of the chat
    - `id` string, required
    - `role` 'ADMIN' | 'MEMBER', required: The role of the member in the chat
    - `user` UserPublicSchema
      - `id` string, required
      - `name` string, nullable, required
      - `avatar` string, nullable, required
    - `session` PublicSessionSchema: Data that is publicly accessible for a session
      - `id` string, required
    - `contact_channel` PublicContactChannelSchema: Schema for the public contact channel
      - `id` string, required
      - `type` 'internal' | 'org' | 'agent' | 'custom' | 'whatsapp_bot' | 'messenger_bot' | 'instagram_dm' | 'tiktok_dm' | 'telegram_bot' | 'slack_bot' | 'teams_bot' | 'gmail' | 'outlook' | 'twilio' | 'telnyx' | 'email' | 'smpp', required: The channel type
      - `user_id` string, required: The unique identifier for the contact channel, e.g Phone Number or User ID
      - `avatar` string, nullable, required: The avatar for the contact channel, e.g X Avatar URL
      - `name` string, nullable, required: The name for the contact channel, e.g Full Name
      - `username` string, nullable, required: The username for the contact channel, e.g Username
      - `email` string, email, nullable, required: The email for the contact channel, e.g Email
      - `phone` string, nullable, required: The phone number for the contact channel, e.g Phone Number
      - `country` string, nullable, required: The country code associated with the contact channel, e.g US for United States
      - `agent` string, nullable, required: The user agent associated with the contact channel
      - `ip` string, nullable, required: The IP address associated with the contact channel
      - `language` string, nullable, required: The language code associated with the contact channel, e.g en for English
      - `link` string: A link to the contact channel, e.g a link to the social media profile
      - `contact` PublicContactSchema, required: Schema for the contact
        - `id` string, required
        - `name` string, nullable, required
        - `blocked` boolean, required
        - `unsubscribed` boolean, required
        - `ai_replies` boolean, required
        - `is_admin` boolean, required
        - `segments` SegmentLimitedSchema[]
          - `id` string, required
          - `name` string, required
          - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral', required: Accent color, by name
          - `contacts_count` number, required
          - `created_at` string, date-time, required
          - `updated_at` string, date-time, required
    - `agent` AgentLimitedSchema: A reduced agent reference
      - `id` string, required
      - `name` string, required
      - `icon` union, required: A picked icon or emoji. Null = the generated face, unless a custom image is set.
        - string, emoji: The emoji of a curated icon a user can pick for a table, view, field, or other entity
        - 'TableCellsIcon' | 'DatabaseIcon' | 'DocumentTextIcon' | 'DocumentChartBarIcon' | 'ClipboardDocumentListIcon' | 'ClipboardDocumentCheckIcon' | 'FolderIcon' | 'ArchiveBoxIcon' | 'InboxIcon' | 'BookOpenIcon' | 'BookmarkIcon' | 'NewspaperIcon' | 'RectangleStackIcon' | 'PencilSquareIcon' | 'UserIcon' | 'UsersIcon' | 'UserGroupIcon' | 'UserPlusIcon' | 'IdentificationIcon' | 'FaceSmileIcon' | 'HandThumbUpIcon' | 'HeartIcon' | 'StarIcon' | 'CheckBadgeIcon' | 'TrophyIcon' | 'CrownIcon' | 'ChatBubbleLeftIcon' | 'ChatBubbleLeftRightIcon' | 'EnvelopeIcon' | 'EnvelopeOpenIcon' | 'PhoneIcon' | 'DevicePhoneMobileIcon' | 'MegaphoneIcon' | 'BellIcon' | 'PaperAirplaneIcon' | 'AtSymbolIcon' | 'RssIcon' | 'LifebuoyIcon' | 'ShoppingCartIcon' | 'ShoppingBagIcon' | 'BuildingStorefrontIcon' | 'CreditCardIcon' | 'BanknotesIcon' | 'CurrencyDollarIcon' | 'CurrencyEuroIcon' | 'ReceiptPercentIcon' | 'WalletIcon' | 'CoinsIcon' | 'GiftIcon' | 'TagIcon' | 'TicketIcon' | 'ScaleIcon' | 'TruckIcon' | 'CubeIcon' | 'CalendarIcon' | 'CalendarDaysIcon' | 'CalendarDateRangeIcon' | 'ClockIcon' | 'FlagIcon' | 'CheckCircleIcon' | 'ListBulletIcon' | 'QueueListIcon' | 'FunnelIcon' | 'ChartBarIcon' | 'ChartPieIcon' | 'PresentationChartLineIcon' | 'ArrowTrendingUpIcon' | 'BriefcaseIcon' | 'WrenchScrewdriverIcon' | 'Cog6ToothIcon' | 'KeyIcon' | 'LockClosedIcon' | 'ShieldCheckIcon' | 'BoltIcon' | 'LightBulbIcon' | 'BeakerIcon' | 'BugAntIcon' | 'CpuChipIcon' | 'CodeBracketIcon' | 'CommandLineIcon' | 'ServerIcon' | 'LinkIcon' | 'HomeIcon' | 'HomeModernIcon' | 'BuildingOfficeIcon' | 'BuildingOffice2Icon' | 'BuildingLibraryIcon' | 'MapPinIcon' | 'MapIcon' | 'GlobeAltIcon' | 'GlobeAmericasIcon' | 'RocketLaunchIcon' | 'PlaneIcon' | 'CarIcon' | 'SunIcon' | 'MoonIcon' | 'FireIcon' | 'SparklesIcon' | 'CakeIcon' | 'AcademicCapIcon' | 'ScissorsIcon' | 'SwatchIcon' | 'PaintBrushIcon' | 'CoffeeIcon' | 'UtensilsIcon' | 'LeafIcon' | 'DumbbellIcon' | 'HeartPulseIcon' | 'PawPrintIcon' | 'StethoscopeIcon' | 'CameraIcon' | 'PhotoIcon' | 'FilmIcon' | 'VideoCameraIcon' | 'MicrophoneIcon' | 'MusicalNoteIcon' | 'SpeakerWaveIcon' | 'PlayCircleIcon' | 'TvIcon' | 'RadioIcon' | 'PuzzlePieceIcon' | 'GamepadIcon': The name of a curated icon a user can pick for a table, view, field, or other entity
      - `color` 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'neutral', required: The identity color, reused by every surface that carries the agent
      - `shape` 'square' | 'round' | 'pebble' | 'slate' | 'beam' | 'bloom' | 'arch' | 'clave', required: The silhouette of a generated agent face
      - `avatar_url` string, nullable, required: The agent as an image, either the custom picture or the PNG snapshot of its face or icon
    - `seen_at` string, date-time, nullable
  - `status` 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELED', required: The chat status
  - `error` string: Error message if the message failed
  - `broadcast_id` string: ID of the broadcast this message originates from
  - `is_broadcast_message` boolean: Whether this message was sent via a broadcast template
  - `channel_type` 'internal' | 'org' | 'agent' | 'custom' | 'whatsapp_bot' | 'messenger_bot' | 'instagram_dm' | 'tiktok_dm' | 'telegram_bot' | 'slack_bot' | 'teams_bot' | 'gmail' | 'outlook' | 'twilio' | 'telnyx' | 'email' | 'smpp': The channel the message arrived through, if any
  - `usage` ModelUsageSchema: The usage information for the message
    - `input_tokens` number: Number of input tokens used by the model
    - `output_tokens` number: Number of output tokens generated by the model
    - `total_tokens` number: Total number of tokens used by the model
    - `reasoning_tokens` number: Number of reasoning tokens used by the model
    - `input_tokens_cache_read` number: Number of input tokens cached read by the model
    - `input_tokens_cache_write` number: Number of input tokens cached written by the model
    - `turns` ModelUsageTurnSchema[]
      - `input_tokens` number: Number of input tokens used by the model
      - `output_tokens` number: Number of output tokens generated by the model
      - `total_tokens` number: Total number of tokens used by the model
      - `reasoning_tokens` number: Number of reasoning tokens used by the model
      - `input_tokens_cache_read` number: Number of input tokens cached read by the model
      - `input_tokens_cache_write` number: Number of input tokens cached written by the model
  - `cost` ModelUsageCostSchema: The cost of a message, at the rates it is billed at
    - `total` number, required: Amount billed for the message, in USD
    - `base` number, required: Amount at the chat's base rate, before any discount, in USD
    - `lines` ModelUsageCostLinesSchema, required: Share of the base amount per token type, in USD
      - `input` number, required
      - `output` number, required
      - `reasoning` number, required
      - `cache_read` number, required
      - `cache_write` number, required
  - `delivered_at` string, date-time, nullable: When the message was delivered to the recipient
  - `reactions` ChatMessageReactionSchema[]: Emoji reactions on the message
    - `emoji` string, required
    - `member_id` string: Reacting member; absent when the AI reacted
  - `created_at` string, date-time, nullable, required
  - `updated_at` string, date-time, nullable, required

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
