---
title: "Update a message"
method: PUT
path: "/api/tickets/{ticket_id}/messages/{id}"
tags: ["Ticket Messages"]
---

# Update a message

`PUT /api/tickets/{ticket_id}/messages/{id}`

## Path parameters

- `ticket_id` integer, required
- `id` integer, required

## Query parameters

- `action` 'force' | 'retry' | 'cancel'

## Request body

- object
  - `attachments` object[] — A list of files attached to the message.
    - `url` string, url, required — The URL to access to the attached file.
    - `name` string, required — The name of the file.
    - `size` integer, nullable, required — The size of the file, in bytes.
    - `content_type` string, required — The MIME type of the file.
    - `public` boolean — Whether or not the attachment can be accessed.
    - `extra` unknown
  - `body_html` string, nullable — The full HTML version of the body of the message, if any.
  - `body_text` string, nullable — The full text version of the body of the message, if any.
  - `channel` 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'help-center' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'phone' | 'sms' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo-review', required — The channel used to send the message.
  - `external_id` string, nullable — ID of the message in a foreign system (Aircall, Zendesk, etc...). This field is not used by Gorgias, feel free to set it as you wish.
  - `failed_datetime` string, date-time, nullable — When the message failed to be sent. Messages that couldn't be sent can be resend.
  - `from_agent` boolean, required — Whether the message was sent by your company to a customer, or the opposite.
  - `message_id` string, nullable — ID of the message on the service that send the message.It can be the ID of an email, a Messenger message, a Facebook comment, etc...
  - `receiver` object — The primary receiver of the message. It can be a user or a customer. Optional when the source type is "internal-note".
    - `id` integer — ID of the customer or user.
    - `email` string — Primary email address of the customer or user.
  - `sender` object — The person who sent the message. It can be a user or a customer.
    - `id` integer — ID of the customer or user.
    - `email` string — Primary email address of the customer or user.
  - `sent_datetime` string, date-time, nullable — When the message was sent. If ommited, the message will be sent by Gorgias.
  - `source` object — Information used to route the message. It contains the names and the addresses of the sender and receivers.
    - `type` string — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
    - `to` object[] — A list of To addresses. To and From are usually present for most channel types.
      - `name` string, nullable — Name of this address. Usually person's first + last name.
      - `address` string — Actual address of the entry. Can be an email, facebook id, phone number, etc..
    - `cc` object[] — A list of CC addresses. Only present in an email context.
      - `name` string, nullable — Name of this address. Usually person's first + last name.
      - `address` string — Actual address of the entry. Can be an email, facebook id, phone number, etc..
    - `bcc` object[] — A list of BCC addresses. Only present in an email context.
      - `name` string, nullable — Name of this address. Usually person's first + last name.
      - `address` string — Actual address of the entry. Can be an email, facebook id, phone number, etc..
    - `from` object — A single From address. To and From are usually present for most channel types.
      - `name` string, nullable — Name of this address. Usually person's first + last name.
      - `address` string — Actual address of the entry. Can be an email, facebook id, phone number, etc..
  - `subject` string, nullable — The subject of the message.
  - `via` 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'form' | 'help-center' | 'helpdesk' | 'instagram' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'phone' | 'rule' | 'shopify' | 'sms' | 'twilio' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo' | 'yotpo-review' | 'zendesk' — How the message has been received, or sent from Gorgias.

## Response `202`

The updated message.

- TicketMessage — A ticket-message represents a message (an email, an SMS, a Facebook comment, chat message, etc..) under a normalized format. There are 3 types of messages: - Outgoing messages: messages sent by your company (by rules or support agents) to your customers. - Incoming messages: messages sent by your [customers](#the-customer-object) to your company. - Internal notes: internal messages sent between support agents ([users](#the-user-object)). Internal notes are not sent/shared with your customers. A ticket-message is associated with only one ticket.
  - `id` integer, required — ID of the message.
  - `uri` string, required — URI of the message.
  - `message_id` string, required — ID of the message on the service that sent the message.It can be the ID of an email, a Messenger message, a Facebook comment, etc...
  - `ticket_id` integer, required — The ID of the ticket the message is associated with.
  - `external_id` string, required — ID of the message in a foreign system (Aircall, Zendesk, etc...). This field is not used by Gorgias, feel free to set it as you wish.
  - `public` boolean — Whether the message was sent/receive by a customer. Internal notes are not public.
  - `channel` union, required — The channel used to send the message.
    - 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'help-center' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'phone' | 'sms' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo-review'
    - string
  - `via` 'aircall' | 'api' | 'chat' | 'contact_form' | 'email' | 'facebook' | 'facebook-mention' | 'facebook-messenger' | 'facebook-recommendations' | 'form' | 'gorgias_chat' | 'help-center' | 'helpdesk' | 'instagram' | 'instagram-ad-comment' | 'instagram-comment' | 'instagram-direct-message' | 'instagram-mention' | 'internal-note' | 'offline_capture' | 'phone' | 'rule' | 'self_service' | 'shopify' | 'sms' | 'twilio' | 'twitter' | 'twitter-direct-message' | 'whatsapp' | 'yotpo' | 'yotpo-review' | 'zendesk', required
  - `source` TicketMessageSource, required
    - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
    - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
      - `name` string
      - `address` string
    - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
      - `name` string
      - `address` string
    - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
      - `name` string
      - `address` string
    - `from` TicketMessageSourceAddress
      - `name` string
      - `address` string
    - `extra` unknown
  - `sender` TicketMessageUserOrCustomer, required
    - `id` integer, required
    - `email` string, required
    - `name` string, required
    - `firstname` string, required
    - `lastname` string, required
    - `meta` unknown, required
  - `auth_customer_identity` TicketMessageAuthCustomerIdentity, required
    - `service` TicketMessageAuthCustomerIdentityService, required
      - `id` string, required — The ID of the service the identity belongs to.
      - `name` string, required — The name of the service the identity belongs to.
    - `identifier` string, required — The ID of the customer related to the service. E.g.: email address, phone number, Shopify customer ID, etc.
  - `integration_id` integer, required — ID of the integration that either received or sent the message.
  - `intents` TicketMessageIntent[], required
    - `name` string, required — The intention the message probably has, example: discount/request
    - `rejected` boolean, required — Whether or not the intent was rejected
    - `is_user_feedback` boolean, required — Whether or not the intent comes from a user feedback
  - `rule_id` integer, required — ID of the rule which sent the message, if any.
  - `from_agent` boolean, required — Whether the message was sent by your company to a customer, or the opposite.
  - `receiver` TicketMessageUserOrCustomer, required
    - `id` integer, required
    - `email` string, required
    - `name` string, required
    - `firstname` string, required
    - `lastname` string, required
    - `meta` unknown, required
  - `subject` string, required — The subject of the message.
  - `body_text` string, required — The full text version of the body of the message, if any.
  - `body_html` string, required — The full HTML version of the body of the message, if any.
  - `stripped_text` string, required — The text version of the body of the message without email signatures and previous replies.
  - `stripped_html` string, required — The HTML version of the body of the message without email signatures and previous replies.
  - `stripped_signature` string, required
  - `attachments` TicketMessageAttachment[], required — A list of files attached to the message.
    - `url` string, required — The URL to access to the attached file.
    - `name` string — The name of the file.
    - `size` integer — The size of the file, in bytes.
    - `content_type` string, required — The MIME type of the file.
    - `public` boolean — Whether or not the attachment can be accessed.
    - `extra` unknown
  - `macros` TicketMessageMacro[] — A list of macros.
    - `id` integer, required
  - `actions` object[], required — A list of actions executed before the message was sent. These actions are set by macros.
  - `headers` object — Message headers. Used for email messages.
  - `imported` boolean, required — Whether the message was created by a historical import.
  - `meta` unknown, required
  - `created_datetime` string, date-time, required — When the message was created.
  - `processed_datetime` string, date-time, required — When the message was processed by Gorgias. Differs from `created_datetime` which refers to the external service.
  - `deleted_datetime` string, date-time — When the message was deleted.
  - `sent_datetime` string, date-time, required — When the message was sent. If omitted, the message will be sent by Gorgias.
  - `failed_datetime` string, date-time, required — When the message failed to be sent. Messages that couldn't be sent can be resend.
  - `opened_datetime` string, date-time, required — When the message was opened by the primary receiver.
  - `last_sending_error` TicketMessageSendingError, required
    - `error` string, required
  - `is_retriable` boolean, required — It determines if the message can be retried or not.
  - `replied_by` TicketMessageRepliedByOrTo
    - `integration_id` integer, required — ID of the integration which created the message.
    - `message_id` string, required — ID of the message in Gorgias.
    - `created_datetime` string, date-time, required — When the message was created.
    - `body_text` string, required — The full text version of the body of the message, if any.
    - `source` TicketMessageSource, required
      - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
      - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
        - `name` string
        - `address` string
      - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `from` TicketMessageSourceAddress
        - `name` string
        - `address` string
      - `extra` unknown
    - `customer` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required
    - `user` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required
  - `replied_to` TicketMessageRepliedByOrTo
    - `integration_id` integer, required — ID of the integration which created the message.
    - `message_id` string, required — ID of the message in Gorgias.
    - `created_datetime` string, date-time, required — When the message was created.
    - `body_text` string, required — The full text version of the body of the message, if any.
    - `source` TicketMessageSource, required
      - `type` string, required — Describes a more detailed channel information of how the message was sent/received. Either the slug of a non-legacy channel or one of aircall,api,app,chat,chat-contact-form,chat-offline-capture,contact-form,email,facebook-comment,facebook-message,facebook-messenger,facebook-post,facebook-mention-post,facebook-mention-comment,facebook,facebook-review,facebook-review-comment,form,help-center,helpdesk,instagram-ad-comment,instagram-ad-media,instagram-comment,instagram-mention-comment,instagram-media,instagram-mention-media,instagram,instagram-direct-message,internal-note,ottspott-call,phone,rule,self_service,shopify,sms,system-message,twilio,yotpo-review,yotpo-review-public-comment,yotpo-review-private-comment,twitter-tweet,twitter-quoted-tweet,twitter-mention-tweet,twitter-direct-message,help-center-contact-form,whatsapp-message.
      - `to` TicketMessageSourceAddress[] — A list of To addresses. To and From are usually present for most channel types.
        - `name` string
        - `address` string
      - `cc` TicketMessageSourceAddress[] — A list of CC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `bcc` TicketMessageSourceAddress[] — A list of BCC addresses. Only present in an email context.
        - `name` string
        - `address` string
      - `from` TicketMessageSourceAddress
        - `name` string
        - `address` string
      - `extra` unknown
    - `customer` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required
    - `user` TicketMessageUserOrCustomer, required
      - `id` integer, required
      - `email` string, required
      - `name` string, required
      - `firstname` string, required
      - `lastname` string, required
      - `meta` unknown, required

---

[API](https://skmtc.net/gorgias/apis/gorgias-rest-api.md) · [All operations](https://skmtc.net/gorgias/apis/gorgias-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gorgias/gorgias-rest-api/versions/36f2e31f4e81/schema)
