← All help

Agents and the API

You can hand an AI a key to this account and let it build your flows. Not a chat box that suggests one — the real thing: it reads your lists, your segments and the events coming out of your shop, writes the emails, assembles the flow, and hands it back for you to switch on.

No other email platform lets you do this. Brevo and Klaviyo have an API for contacts and campaigns; neither lets anything build a flow.

Two rules make it safe:

Get a key

Go to the Agents & API screen, at /automations/agents, and press Issue key. Settings → General → API keys links to it as Agents & MCP. (The old address, /settings/agents, now opens API keys, where your other keys live.)

Treat it like a password. Anyone holding it can build flows in your brand.

Connect Claude Code

One line in a terminal. The screen prints it with your key already in it:

claude mcp add --transport http amino-engine \
  https://app.aminoengine.com/api/mcp \
  --header "Authorization: Bearer PASTE-YOUR-KEY-HERE"

Then type /mcp inside Claude Code and amino-engine is listed. Tell it: "Read the guide, then build me a welcome series."

Connect claude.ai or Claude desktop

Settings → Connectors → Add custom connector. Paste this as the URL and name it Amino Engine:

https://app.aminoengine.com/api/mcp?token=PASTE-YOUR-KEY-HERE

The key is in the address here because a custom connector is only an address — there is nowhere else to put it. That is your own browser and your own connector settings, and it is the one place we accept a key that way.

Connect anything else

Anything that can make a web request. Send the key as a header:

curl -sS https://app.aminoengine.com/api/agent/v1/me \
  -H "Authorization: Bearer PASTE-YOUR-KEY-HERE"

/me changes nothing and is the right first call: it proves the key works, names the brand, and says what the agent is allowed to do right now.

Everything lives under https://app.aminoengine.com/api/agent/v1/. Bodies and answers are JSON.

How much rope

Two settings on the Agents & API screen, and one of them is a stop button.

Setting What it means
Build drafts only (the default) It creates and edits flows and emails. A person switches each flow on.
May switch flows on Everything above, and it can turn a finished flow on by itself.
Agent on / off Off refuses every request with the key, without losing the key. One click to stop everything.

Pausing is allowed on both settings. Turning something off is the safe direction, and an agent that spots a flow misfiring at 3am should not have to wait for you.

On the cautious setting, an attempt to switch a flow on comes back refused, in words the agent can act on: "This brand lets the agent build drafts only. Ask a person to switch it on."

Some things the agent can never do, on either setting:

How a flow gets built

The agent works in five steps, and the guide it reads first says so:

  1. Look at what you have. Your lists, your segments, the events your shop is sending, the emails you have already designed.
  2. Write the emails it needs, or reuse yours.
  3. Compose the flow as one JSON document.
  4. Create it. It arrives switched off.
  5. Ask you to switch it on — or switch it on itself, if you allowed that.

The flow itself

Every flow in this platform, whether a person dragged it or an agent wrote it, is one JSON document with five fields.

Field What it is
trigger What starts it. A list someone joins, an event from your shop, a segment they enter, or a date on the person (birthday, renewal).
entryFilters Who is allowed in. Checked once at the door. Somebody who fails is never enrolled at all. Optional.
exitConditions What ends it early. "They ordered" is the usual one — an abandoned-cart flow must stop the moment the order lands.
steps The work: emails, texts, waits, branches, list changes, team alerts. Every step has an id and points at the next one by id.
entryStepId Which step runs first.

The rules the checker enforces, and refuses the whole document over:

The machine-readable version of all of this — the full schema, the rules as sentences, and the three examples below — is one call: GET /api/agent/v1/flows/schema, or the flow_schema tool. An agent that reads it builds a valid flow first try.

Three worked examples

The template and list ids below are zeros. Real ones come from list_templates and list_lists.

A welcome series. Somebody joins a list, gets an email, waits two days, gets another.

{
  "trigger": {
    "kind": "list_added",
    "listId": "00000000-0000-0000-0000-000000000000"
  },
  "entryStepId": "email-1",
  "exitConditions": [],
  "steps": [
    {
      "id": "email-1",
      "kind": "send_email",
      "templateId": "00000000-0000-0000-0000-000000000000",
      "next": "wait-1"
    },
    { "id": "wait-1", "kind": "wait", "minutes": 2880, "next": "email-2" },
    {
      "id": "email-2",
      "kind": "send_email",
      "templateId": "00000000-0000-0000-0000-000000000000",
      "next": "end"
    },
    { "id": "end", "kind": "exit" }
  ]
}

An abandoned cart. Started by the shop's checkout event, waits an hour, and only mails the people who still have not ordered. The exit condition is the belt to the branch's braces: it stops the run the instant an order arrives.

{
  "trigger": {
    "kind": "event",
    "name": "checkout_started",
    "source": "woocommerce"
  },
  "entryStepId": "wait-1",
  "exitConditions": [{ "event": "order_created" }],
  "steps": [
    { "id": "wait-1", "kind": "wait", "minutes": 60, "next": "check" },
    {
      "id": "check",
      "kind": "branch",
      "paths": [
        {
          "name": "still has not ordered",
          "when": [
            {
              "kind": "not_had_event_since_entry",
              "name": "order_created"
            }
          ],
          "next": "email-1"
        }
      ],
      "otherwise": "end"
    },
    {
      "id": "email-1",
      "kind": "send_email",
      "templateId": "00000000-0000-0000-0000-000000000000",
      "next": "end"
    },
    { "id": "end", "kind": "exit" }
  ]
}

A birthday text, for people on one list only.

{
  "trigger": {
    "kind": "date_property",
    "attribute": "birthday",
    "offsetDays": 0,
    "atHour": 9
  },
  "entryFilters": [
    {
      "kind": "in_list",
      "listId": "00000000-0000-0000-0000-000000000000"
    }
  ],
  "entryStepId": "sms-1",
  "exitConditions": [],
  "steps": [
    {
      "id": "sms-1",
      "kind": "send_sms",
      "body": "Happy birthday from all of us. 20% off anything today.",
      "next": "end"
    },
    { "id": "end", "kind": "exit" }
  ]
}

Every address

All of them under https://app.aminoengine.com/api/agent/v1, all with Authorization: Bearer YOUR-KEY.

Call What it does
GET /me Who am I: the brand, how much rope, whether the agent is switched on, and the team addresses an alert step may use.
GET /guide The written guide for the agent. Read this first.
GET /flows/schema The flow schema, the rules, and the three examples.
GET /flows Every flow, newest first. ?status=draft, live or off to narrow it.
POST /flows Make one. A name plus either a definition or a library flow to start from.
GET /flows/{id} One flow in full, with its definition and how many people are in it.
PATCH /flows/{id} Change the name, the definition, the tags or the sending rules.
DELETE /flows/{id} Delete one.
POST /flows/{id}/status Switch it on or off.
POST /flows/{id}/clone Copy it, switched off.
GET /library The ready-made flows, and whether this brand has what each one needs.
GET /templates · POST /templates List the email designs, or write a new one.
GET /templates/{id} · PATCH /templates/{id} Read one, or edit one it wrote.
GET /lists · POST /lists Your lists, or a new one.
GET /segments Your segments, with how many people are in each.
GET /events Every event this brand actually receives, and how often.

Every tool

Over MCP the same work is nineteen tools:

Tool What it does
whoami The brand, the rope, whether the agent is on, and the team addresses an alert step may use.
guide The written guide. Call it first.
flow_schema The schema, the rules and three valid examples.
list_flows Every flow, with its trigger and how many steps.
get_flow One flow in full.
create_flow Build one, from a definition or from the library.
update_flow Change a flow that is not running.
set_flow_status Switch a flow on or off.
clone_flow Copy a flow.
delete_flow Delete a flow.
list_library The ready-made flows and what each one needs.
list_templates Every email design, and whether it can be edited.
get_template One design, with its HTML.
create_template Write a new email.
update_template Edit one it wrote.
list_lists Your lists and their sizes.
create_list Make a list.
list_segments Your segments and their sizes.
list_events The events your shop and site are sending.

When it goes wrong

Every refusal is one sentence saying what to do about it, and most carry a hint as well.

Answer What happened
401 The key is wrong, missing, or was replaced. Issue a new one on the Agents & API screen.
403 The agent is switched off for this brand, or it is on build drafts only and tried to switch a flow on.
404 No flow, template or list with that id in this brand.
409 The flow is live (pause it first), or its trigger is already set (copy the flow instead), or the email was built in the visual editor and cannot have its HTML replaced.
413 The body was too big. An email design can be up to 102 KB.
422 The flow did not pass the checker. The answer names the field and the rule.
429 Too many calls. 300 a minute per brand. Wait the number of seconds it tells you.

What you see afterwards

Everything the agent does is written to your activity log, the same one your own changes go to, with the agent named as the actor. It shows on the Agents & API screen — the last fifty things, newest first — and in Settings → General → Activity log in full.

Built a flow. Edited a flow. Wrote an email. Paused a flow. Switched a flow on. Each row links to the flow it touched, so you can open it and read what was actually built before anything goes out.

If something is there you did not expect: switch the agent off, or revoke its key. The flows it already built stay exactly as they are, and none of them send until they are switched on.

If it didn’t work

  1. The agent says the key is wrong. Issue a new one on the Agents & API screen and paste it in again. Issuing a key kills the one before it, so an agent still holding the old key stops the second you press the button — that is the intended way to cut one off.
  2. The agent says it is switched off. Somebody turned the agent off for this brand. Turn it back on from the Agents & API screen.
  3. It built the flow but could not switch it on. The agent is on build drafts only. Either switch the flow on yourself, or give the agent more rope on the Agents & API screen.
  4. It cannot find your list or your template. Ids belong to one brand. An agent pointed at the wrong brand sees nothing at all rather than somebody else’s things, which is deliberate.
  5. It keeps being told to wait. Three hundred calls a minute per brand is the ceiling. The answer says how many seconds to wait; a well-behaved agent waits and carries on.
  6. A flow it built has sent nothing. Nothing sends until the flow is switched on and your sending address is verified. Neither of those is something an agent can do for you.
  7. You do not recognise what it did. Switch the agent off, or revoke its key, and read Settings → General → Activity log. Anything it built stays as a draft and sends nothing.

Still stuck? Email support@aminoengine.com — we answer within one business day.

Last updated 2026-09-24.
Still stuck? Email support@aminoengine.com — we answer within one business day.