---
title: "Create an email sequence"
method: POST
path: "/email-sequences"
tags: ["Email"]
---

# Create an email sequence

`POST /email-sequences`

## Request

- Base URL: `https://api.hypamoon.com/api/v1`
- URL: `https://api.hypamoon.com/api/v1/email-sequences`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://app.hypamoon.com/oauth/authorize`, token URL `https://api.hypamoon.com/oauth/token`, scopes: `messages:write`)

A series of 1 to 20 emails, each a template with a wait before it (in minutes, at most 30 days). Someone joins with POST /email-sequences/{id}/enrollments or through an automation. It stops for a person when they unsubscribe (always), when an event in stop_on happens for their address (like order.paid), or with POST /email-sequences/{id}/stop. category other (default) gives every email an unsubscribe link.

## Request body

- object
  - `name` string, required: A name, like "Onboarding".
  - `steps` object[], required: 1 to 20 emails, each a template with a wait before it.
    - `template_id` string, uuid, required
    - `wait_minutes` integer, required: Minutes to wait before this step: after joining for the first step, after the previous email for the next.
  - `stop_on` string[]: Stop for a person when one of these happens for their address, like order.paid, or subscription.recovered and subscription.canceled for reminders about a failed payment. Unsubscribing always stops.
  - `from` string, required: The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme <hello@acme.com>".
  - `reply_to` string: Optional. Where replies go, like the owner's own mailbox.
  - `category` 'transactional' | 'other': other (default): every email has an unsubscribe link. transactional only for steps that follow up on something the person did.

## Response `201`

The sequence.

- object
  - `id` string, uuid, required
  - `name` string, required
  - `steps` object[], required
    - `template_id` string, uuid, required
    - `wait_minutes` integer, required
  - `stop_on` string[], required
  - `from` string, required
  - `reply_to` string, nullable, required
  - `category` 'transactional' | 'other', required
  - `active` integer, required: How many people are in the sequence now.
  - `created_at` string, date-time, required

## Other responses

- `400`: Bad Request: invalid_json.
- `401`: Unauthorized: unauthorized, missing_api_key, invalid_api_key, api_key_revoked, project_deleted.
- `403`: Forbidden: project_not_enabled, key_mode_mismatch, missing_scope, verification_required.
- `404`: Not Found: not_found.
- `409`: Conflict: email_domain_not_verified, conflict.
- `422`: Unprocessable Content: validation_failed.
- `429`: Too Many Requests: rate_limited.
- `500`: Internal Server Error: internal_error.
- `503`: Service Unavailable: service_unavailable.

---

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