Update a one-time send variant
Update the content of a one-time send (referred to as a "newsletter" in our APIs): the default message, a test variant in an A/B test group, or a translation.
For an email, you can also update the envelope: from address, subject line, etc.
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: You cannot manage content made with the drag-and-drop editor via API, and you cannot use this endpoint to update Design Studio emails. You can, however, manage Design Studio content with other endpoints. You also can't update in-app or inbox message content through the API—use the message editor instead.
- Type: integernewsletter
_id requiredThe identifier of a one-time send.
- Type: integercontent
_id requiredThe identifier of a message in a one-time send. If your one-time send has an A/B test group or includes multiple languages, each variant has its own
content_id, separate from thenewsletter_id.Use List variants of a one-time send to find the
content_idassociated with the right variant.
Update the contents of an email one-time send variant. You can set the sender with
from_id. If you don't provide it, the existing sender is preserved.- Type: stringbody
The HTML body of the email. You cannot modify the body if you created the one-time send with Design Studio or the drag-and-drop editor.
- Type: stringbody
_amp AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your
bodycontent instead. Make sure you're set up to send AMP first. - Type: stringbody
_plain By default, your workspace generates a plaintext version of your message body for each delivery. Use this key to override the default plain text body.
- Type: integerfrom
_id The identifier of the
fromaddress, commonly known as the "sender". Use List sender identities to find valid IDs. - Type: stringpreheader
_text Also known as "preview text", this is the small block of text shown in an email inbox next to or underneath the subject line.
- Type: stringrecipient
The recipient address for the one-time send. By default, it's
{{customer.email}}. - Type: integer | nullreply
_to _id The identifier for the
reply_toaddress, if applicable. Use List sender identities to find valid IDs. - Type: stringsubject
The subject line for an
emailaction.
- application/json
- 400
The request is malformed.
- 404
The one-time send or variant does 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.
- application/json
{
"body": "",
"body_amp": "",
"body_plain": "",
"from_id": 1,
"preheader_text": "",
"recipient": "",
"reply_to_id": 38,
"subject": "Did you get that thing I sent you?"
}
{
"content": {
"bcc": "string",
"body": "<strong>Hello from the API</strong>",
"body_amp": "string",
"cc": "string",
"deduplicate_id": "15:1492548073",
"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": 1,
"image_url": "string",
"language": "fr",
"layout": "<html><body>{{ content }}</body></html>",
"name": "one-time send variant A",
"newsletter_id": 10,
"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"
}
}Returns the updated one-time send variant.