---
title: "Add an action to an automation email"
method: POST
path: "/automation-emails/{id}/actions"
tags: ["Automations"]
---

# Add an action to an automation email

`POST /automation-emails/{id}/actions`

## Request

- Base URL: `https://api.sendfox.com`
- URL: `https://api.sendfox.com/automation-emails/{id}/actions`
- Auth: OAuth 2
  - Authorization code: `https://sendfox.com/oauth/authorize`
  - Token URL: `https://sendfox.com/oauth/token`

Adds or removes a tag or list when a contact is sent, opens, or clicks this email, and can also take them out of the automation. Set exactly one of contact_tag_id and list_id.

## Request body

- object
  - `event` 'send' | 'open' | 'click', required
  - `action` 'add' | 'remove', required
  - `contact_tag_id` integer
  - `list_id` integer
  - `link_url` string: Click event only. Run for this link, as written in the email. Omit for any link.
  - `ends_automation` boolean

## Response `201`

Action created

- AutomationEmailAction: Adds or removes a tag or list when a contact is sent, opens, or clicks an automation email.
  - `id` integer
  - `automation_email_id` integer
  - `event` 'send' | 'open' | 'click'
  - `action` 'add' | 'remove'
  - `contact_tag_id` integer, nullable
  - `list_id` integer, nullable
  - `link_url` string, nullable: For a click action, the only link that runs it. Null means any link.
  - `ends_automation` boolean: Whether this also takes the contact out of the automation.

## Other responses

- `402`: Payment Required (API access requires a paid plan)
- `403`: Forbidden. Most often an ownership/authorization failure (Laravel's default `{"message": "..."}` shape). If the account is restricted by SendFox, the response instead carries the structured `account_restricted` body with a link to the account status page.
- `404`: Automation email not found
- `422`: Validation error, including a tag or list you don't own, a link that isn't in the email, or adding the tag or list that starts this automation.

## Changes

- **2026-11-07** `e5d5ed3f8062`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sendfox/apis/sendfox-api/changes/automation-emails/:id/actions/post.md)

---

[API](https://skmtc.dev/sendfox/apis/sendfox-api.md) - [All operations](https://skmtc.dev/sendfox/apis/sendfox-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sendfox/apis/sendfox-api/revisions/e45b66045d53?raw)
