v1.0.0
OpenAPI 3.1.0

Update a transactional message

US region

Client Libraries

Update a transactional message

​

Update the body of a transactional email. This fully overwrites your existing transactional message. We'll use your updated content for any future transactional requests (/v1/send/email), so make sure that you test your message before you update it.

SMS and Design Studio: The first time you update the body of an SMS, Customer.io copies the message into Design Studio as a new SMS, the same kind you'd create from the Design Studio dashboard, and links your message to the new SMS. From then on, your message sends whatever the linked SMS contains, and you can also edit that SMS in Design Studio. When you update the message again with this endpoint, Customer.io saves your changes to the linked SMS and publishes them for you. Customer.io doesn't link a message that has translations. You can't set body to an empty string. If the linked SMS has edits in Design Studio that nobody has published, the request fails with a 409 until someone publishes them or restores the last published version.

NOTE: Apart from SMS, you cannot manage content made with Design Studio with this endpoint. Use the Design Studio APIs instead.

Path Parameters
  • transactional_id
    Type: integer
    required

    The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - /transactional/3/templates/139 - the transactional_id is 3.

  • content_id
    Type: integer
    required

    The content variant of your transactional message. You'll find the id in the URL of your transactional message. For example, if this is the path of a transactional message URL - /transactional/3/templates/139 - the content_id is 139.

Body
application/json
  • body
    Type: string

    The body of the transactional message. You cannot modify the body if you created it with our drag-and-drop editor. For an SMS linked to Design Studio, the body returns as SMS markup.

  • body_amp
    Type: string

    AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your body content instead. Make sure you're set up to send AMP first.

  • from_id
    Type: integer

    The identifier of the from address, commonly known as the "sender". Use List sender identities to find valid IDs.

  • headers
    Type: array object[]

    Headers you want to add or update. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers.

  • image_url
    Type: string

    For an SMS, the URL of the image that turns it into an MMS. For an SMS linked to Design Studio, this field returns empty because the image is part of body. To change that image, send image_url together with body, and send an empty image_url to remove the image.

  • preheader_text
    Type: string

    Also known as "preview text", this is the small block of text shown in an email inbox next to or underneath the subject line.

  • recipient
    Type: string

    The recipient address for an action.

  • reply_to_id
    Type: integer | null

    The identifier for the reply_to address, if applicable. Use List sender identities to find valid IDs.

  • subject
    Type: string

    The subject line for an email action.

Responses
  • application/json
  • application/json
  • 404

    The transactional_id or content_id in your request do not exist

  • 409

    The SMS has edits in Design Studio that nobody has published.

  • 422

    The request isn't valid for an SMS linked to Design Studio.

Request Example for put/v1/transactional/{transactional_id}/content/{content_id}
{
  "body": "",
  "body_amp": "",
  "from_id": 1,
  "headers": [
    [
      {
        "name": "X-Mailgun-Tag",
        "value": "my-cool-tag"
      }
    ]
  ],
  "image_url": "",
  "preheader_text": "",
  "recipient": "{{customer.email}}",
  "reply_to_id": 38,
  "subject": "Did you get that thing I sent you?"
}
{
  "content": [
    {
      "bcc": "string",
      "body": "string",
      "body_amp": "string",
      "cc": "string",
      "created": 1552341937,
      "fake_bcc": true,
      "from": "sentFrom@example.com",
      "from_id": 1,
      "headers": "[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"},{\"name\":\"X-Custom-Header\",\"value\":\"custom-value\"}]",
      "id": 96,
      "image_url": "string",
      "language": "fr",
      "name": "Receipt",
      "preheader_text": "string",
      "preprocessor": "premailer",
      "recipient": "{{customer.email}}",
      "reply_to": "replyto@example.com",
      "reply_to_id": 38,
      "subject": "Did you get that thing I sent you?",
      "type": "email",
      "updated": 1552341937
    }
  ]
}