---
title: "Add and remove people"
description: "Puts a contact into a live automation at its first step, whatever its trigger, or takes somebody out before they finish."
url: "https://openemail.uk/docs/api/automations/enroll"
area: "API"
category: "Mailbox"
---

# Add and remove people

Puts a contact into a live automation at its first step, whatever its trigger, or takes somebody out before they finish.

`POST /automations/{id}/enrollments`

**Also documents:** `POST /automations/{id}/enrollments/{enrollmentId}/exit`

## POST /automations/{id}/enrollments

Puts a contact into a live automation at its first step, whatever its trigger, or takes somebody out before they finish.

## Example

Needs `automations:write`. Name the contact by `email` or by `contactId`, never both.

**curl**

```
curl -X POST "$OE/automations/aut_7c2e9a1f4b8d30c65e1a9f27/enrollments" -H "$AUTH" -H 'content-type: application/json' -d '{
  "email": "ana@example.com",
  "data": { "orderId": "A-1042" }
}'
curl -X POST "$OE/automations/aut_7c2e9a1f4b8d30c65e1a9f27/enrollments/aen_2d8f1b6c9e3a47d05b1c8e62/exit" -H "$AUTH"
```

**Response**

```
{
  "object": "automation_enrollment",
  "id": "aen_2d8f1b6c9e3a47d05b1c8e62",
  "automationId": "aut_7c2e9a1f4b8d30c65e1a9f27",
  "version": 2,
  "contact": { "id": "5b0e7c1a-2f4d-4c8b-9a36-1e7d0c5f8b24", "email": "ana@example.com", "name": "Ana Lima" },
  "status": "active",
  "source": "trigger",
  "stepKey": "pause",
  "waiting": true,
  "waitingForEvent": null,
  "heldFor": null,
  "nextRunAt": "2026-10-14T08:02:11.000Z",
  "exitReason": null,
  "lastError": null,
  "startedAt": "2026-10-11T08:02:03.000Z",
  "finishedAt": null,
  "updatedAt": "2026-10-11T08:02:11.000Z"
}
```

> `data` holds values the steps can read wherever a value comes from the event, at most 50 keys and 4 KB of JSON.

> The contact has to exist already: an unknown address answers 404 `contact_not_found`.

> Somebody who is inside already, or who went through an automation that lets people in once, is refused with 409 `already_enrolled`.

> A contact who unsubscribed, bounced or complained is refused with 409 `contact_unreachable`.

> Only a live automation takes people: 409 `automation_not_live`.

> Taking somebody out ends their run with the reason `removed`. An enrollment that already ended answers 409 `automation_enrollment_finished`.

## Reference

- [`POST /automations/{id}/enrollments`](https://openemail.uk/docs/api/reference/automations#post-automations-id-enrollments): full reference
- [`POST /automations/{id}/enrollments/{enrollmentId}/exit`](https://openemail.uk/docs/api/reference/automations#post-automations-id-enrollments-enrollmentid-exit): full reference
