---
name: automations
description: tinysend AI automations — pre-send quality checks, inbound email triage, OTP code extraction, structured data extraction from email, scheduled digests, sender domain health alerts. use when automating workflows on lists or mailboxes.
license: MIT
compatibility: requires network access to api.tinysend.com (see the platform skill for auth)
---

# automations

AI automations that run on lists, mailboxes, or the whole project. enable them, configure them, read their run history — all over the REST API with a bearer token (see the platform skill for auth).

## automation types

| type | entity | what it does |
|------|--------|--------------|
| quality | list | checks posts for broken links, typos, grammar, compliance before sending |
| triage | mailbox | classifies incoming email: category, priority, tags, summary |
| otp | mailbox | extracts one-time verification codes from incoming email |
| extract | mailbox | pulls structured data from emails (dates, amounts, order numbers) |
| digest | list or project | scheduled engagement summary emailed to the project owner |
| domain_health | project | scheduled sender domain check, alerts when DKIM breaks |

entity types: `list`, `mailbox`, `project`. for project-level automations, entity_id is the project id.

## endpoints

```
GET    /v1/automations                                list automations (query: project_id required; entity_type, entity_id optional)
GET    /v1/automations/:id                            automation details
POST   /v1/automations                                create automation
PATCH  /v1/automations/:id                            update config (name, schedule, prompt, enabled)
DELETE /v1/automations/:id                            remove automation
```

## create an automation

```
POST /v1/automations
{
  "project_id": "01ABC...",
  "type": "digest",
  "entity_type": "project",
  "entity_id": "01ABC...",
  "schedule": "0 9 * * 1",
  "system_prompt": "focus on click rates"
}
```

fields:
- `type` — one of the types above
- `entity_type` + `entity_id` — what it attaches to
- `enabled` — default true
- `name` — optional display name
- `schedule` — cron, only for digest and domain_health (see schedules below)
- `system_prompt` — extra instructions appended to the automation's base prompt
- `config` — type-specific JSON, e.g. `{"timezone": "Europe/Berlin"}` for scheduled types

## schedules

digest and domain_health run on a cron schedule. other types are event-driven and ignore `schedule`.

supported cron shapes (5-field, minute hour dom month dow):
- `0 9 * * *` — daily at 09:00
- `0 9 * * 1-5` — weekdays at 09:00
- `0 9 * * 1` — weekly on a single weekday (0=sunday .. 6=saturday)

monthly, steps, and lists are not supported. timezone defaults to Europe/Dublin, override via `config.timezone` (IANA name).

## update / disable

```
PATCH /v1/automations/:id
{"schedule": "0 8 * * *", "config": {"timezone": "America/New_York"}}

PATCH /v1/automations/:id
{"enabled": false}
```

## where results land

- quality — issues summary on the post (`issues_summary` in post details)
- triage / otp / extract — `extracted_data` on the email message
- digest — emailed to the project owner
- domain_health — email alert only when a domain is broken
