v1.0.0
OpenAPI 3.1.0

Update a translation of a newsletter

US region

Client Libraries

Update a translation of a newsletter

Update the translation of a newsletter variant. If your newsletter includes A/B tests, use Update a translation in a newsletter test group.

NOTE: You cannot manage content made with Design Studio with this endpoint. Use the Design Studio APIs instead. You also can't update in-app or inbox message content through the API—change it in the message editor.

Path Parameters
  • newsletter_id
    Type: integer
    required

    The identifier of a newsletter.

  • language
    Type: string
    required

    A language tag of a language variant. If you don't provide a language (an empty string), we'll use your default language. If the language variant does not exist, we'll return an error.

Body
application/json
    • Update the contents of an email newsletter variant. You can set the sender with from_id. If you don't provide it, the existing sender is preserved.

      • body
        Type: string

        The HTML body of the email. You cannot modify the body if you created the newsletter with Design Studio or the drag-and-drop editor.

      • 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.

      • body_plain
        Type: string

        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.

      • from_id
        Type: integer

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

      • 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 the newsletter. By default, it's {{customer.email}}.

      • 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
  • 400

    The language does not exist.

  • 404

    The newsletter or variant does not exist.

  • 429

    Your request is over the 10-per-second limit.

Request Example for put/v1/newsletters/{newsletter_id}/language/{language}
curl 'https://api.customer.io/v1/newsletters/1/language/{language}' \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "body": "",
  "body_amp": "",
  "body_plain": "",
  "subject": "Did you get that thing I sent you?",
  "preheader_text": "",
  "from_id": 1,
  "reply_to_id": 38,
  "recipient": ""
}'
{
  "content": {
    "id": 1,
    "newsletter_id": 10,
    "deduplicate_id": "15:1492548073",
    "name": "newsletter variant A",
    "layout": "<html><body>{{ content }}</body></html>",
    "body": "<strong>Hello from the API</strong>",
    "body_amp": "string",
    "language": "fr",
    "type": "email",
    "from": "sentFrom@example.com",
    "from_id": 1,
    "reply_to": "replyto@example.com",
    "reply_to_id": 38,
    "preprocessor": "premailer",
    "recipient": "{{customer.email}}",
    "subject": "Did you get that thing I sent you?",
    "cc": "string",
    "bcc": "string",
    "fake_bcc": true,
    "preheader_text": "string",
    "headers": "[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"},{\"name\":\"X-Custom-Header\",\"value\":\"custom-value\"}]"
  }
}