# Sequences

Sequences are automated email series that deliver a series of messages to subscribers over time. They're perfect for onboarding flows, educational content, nurture campaigns, and drip marketing. Each sequence contains multiple email templates that are sent based on configured delays and conditions. The Sequences API allows you to retrieve sequences, create sequence emails, and update existing template content programmatically.

## Available Endpoints

| Method                                                      | Endpoint                                                             | Name                                               |
| ----------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------- |
|  |  | [Get Sequences](/docs/sequences_api#get-sequences) |
|  |  | [Create Sequence Email](/docs/sequences_api#create-sequence-email) |
|  |  | [Update Sequence Email](/docs/sequences_api#update-sequence-email) |

## The Sequence Model


  
    The sequence model represents an automated email series with its associated email templates and performance statistics.
  
  
    ### Properties

    
      - **id** (`string`): 
        The unique identifier for the sequence
      
      - **name** (`string`): 
        The name of the sequence
      
      - **created_at** (`datetime`): 
        When the sequence was created
      
      - **email_templates** (`array`): 
        Array of email templates in this sequence, each with id, subject, and stats
      
    

  


---

## Get Sequences {{ tag: 'GET', label: '/v1/fetch/sequences' }}


  
    Returns a list of all sequences in your account, including their associated email templates and performance statistics.

    ### Query Parameters
    
      - **site_uuid** (`string`): 
        Your site's unique identifier
      
      - **page** (`integer`): 
        Page number for pagination (optional)
      
    

  
  
    
  

<br/><br/>

  
    ### Response
    Returns a list of sequences with their email templates and stats.
  
  
    
  


---

## Create Sequence Email {{ tag: 'POST', label: '/v1/fetch/sequences/:id/emails/templates' }}


  
    Creates a new email template inside a sequence.

    
> The sequence `id` is the sequence prefix ID (for example, `sequence_abc123`).


    ### Path Parameters
    
      - **id** (`string`): 
        The sequence prefix ID
      
    

    ### Query Parameters
    
      - **site_uuid** (`string`): 
        Your site's unique identifier
      
    

    ### Request Body
    
      - **email_template.subject** (`string`): 
        Subject line for the new sequence email
      
      - **email_template.html** (`string`): 
        HTML body for the email
      
      - **email_template.delay_interval** (`string`): 
        Optional delay unit: `minutes`, `hours`, `days`, or `months`
      
      - **email_template.delay_interval_count** (`integer`): 
        Optional delay amount (must be paired with `delay_interval`)
      
      - **email_template.inbox_snippet** (`string`): 
        Optional preview text snippet
      
      - **email_template.editor_choice** (`string`): 
        Optional editor mode
      
    

  
  

```bash
curl -L -u publishableKey:secretKey \
  -X POST "https://app.bentonow.com/api/v1/fetch/sequences/sequence_abc123/emails/templates?site_uuid=ExampleID1234" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "email_template": {
      "subject": "Welcome to Bento",
      "html": "<h1>Hello {{ visitor.first_name }}</h1>",
      "delay_interval": "days",
      "delay_interval_count": 7,
      "inbox_snippet": "Start here",
      "editor_choice": "plain"
    }
  }'
```

  

<br/><br/>

  
    ### Response
    Returns the created email template.
  
  

```json
{
  "data": {
    "id": 12345,
    "type": "email_template",
    "attributes": {
      "name": "Welcome to Bento",
      "subject": "Welcome to Bento",
      "html": "<h1>Hello {{ visitor.first_name }}</h1>",
      "created_at": "2026-02-15T10:30:00Z",
      "stats": null
    }
  }
}
```

  


---

## Update Sequence Email {{ tag: 'PATCH', label: '/v1/fetch/emails/templates/:id' }}


  
    Updates an existing sequence email template by template ID.

    
> Update currently supports `subject` and `html` only. Other sequence-email fields (delay, snippet, cc/bcc, etc.) are created via the sequence create endpoint.


    ### Path Parameters
    
      - **id** (`integer`): 
        Email template ID
      
    

    ### Query Parameters
    
      - **site_uuid** (`string`): 
        Your site's unique identifier
      
    

    ### Request Body
    
      - **email_template.subject** (`string`): 
        Updated subject line
      
      - **email_template.html** (`string`): 
        Updated HTML content
      
    

  
  

```bash
curl -L -u publishableKey:secretKey \
  -X PATCH "https://app.bentonow.com/api/v1/fetch/emails/templates/12345?site_uuid=ExampleID1234" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "email_template": {
      "subject": "Updated subject",
      "html": "<h1>Updated HTML</h1>"
    }
  }'
```

  


---