v1.0.0
OpenAPI 3.1.0

Update an automation action

US region

Client Libraries

Update an automation action

Update the contents of an automation action, including the body of messages and HTTP requests.

NOTE: You can't manage content made with Design Studio with this endpoint. Use the Design Studio APIs instead.

Path Parameters
  • campaign_id
    Type: integer
    required

    The ID of the automation that you want to trigger or return information about.

  • action_id
    Type: integer
    required

    The action you want to lookup or act on.

Body
application/json
    • body
      Type: string

      The body of the action. You cannot modify the body if you created it with our 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.

    • broadcast_id
      Type: integer

      The identifier for a broadcast.

    • campaign_id
      Type: integer

      The identifier for an automation.

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

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

    • sending_state
      Type: string enum

      Determines the sending behavior for the action. automatic sends the action automatically when triggered; draft queues drafts when the action is triggered; or off to disable the action.

      values
      • automatic
      • draft
      • off
    • subject
      Type: string

      The subject line for an email action.

Responses
  • application/json
  • 400

    The campaignID or actionID is invalid. It could also be that the language requested does not exist for this action.

  • 404

    The automation and/or action do not exist.

  • application/json
Request Example for put/v1/campaigns/{campaign_id}/actions/{action_id}
{
  "body": "",
  "body_amp": "",
  "broadcast_id": 2,
  "campaign_id": 5,
  "from_id": 1,
  "headers": [
    [
      {
        "name": "X-Mailgun-Tag",
        "value": "my-cool-tag"
      }
    ]
  ],
  "preheader_text": "",
  "recipient": "{{customer.email}}",
  "reply_to_id": 38,
  "sending_state": "automatic",
  "subject": "Did you get that thing I sent you?"
}
{
  "action": {
    "bcc": "string",
    "body": "string",
    "body_amp": "string",
    "broadcast_id": 2,
    "campaign_id": 5,
    "cc": "string",
    "created": 1552341937,
    "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": 96,
    "language": "fr",
    "layout": "string",
    "multi_language_branch_action_id": 23,
    "name": "Opening Message",
    "parent_action_id": 1,
    "preheader_text": "string",
    "preprocessor": "premailer",
    "recipient": "{{customer.email}}",
    "reply_to": "replyto@example.com",
    "reply_to_id": 38,
    "sending_state": "automatic",
    "subject": "Did you get that thing I sent you?",
    "type": "email",
    "updated": 1552341937
  }
}