> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Emails Overview

> Build and send email campaigns, manage templates, and retrieve campaign statistics with the HoopAI Platform REST API.

The HoopAI Platform Emails REST API gives you full programmatic access to email marketing operations. Create and manage drag-and-drop or HTML templates, retrieve scheduled email campaigns and workflow campaigns, fetch bulk-action campaign lists, and pull delivery statistics — all through a single, consistent interface.

## Base URL

```
https://services.leadconnectorhq.com
```

## Authentication

Every request requires a Bearer token and an API version header.

```bash theme={null}
Authorization: Bearer <access_token>
Version: 2021-07-28
```

Use an access token generated with user type **Account**, or a **Private Integration Token** from an Account. See [OAuth 2.0](/api-reference/oauth/overview) for details.

## OAuth scopes

| Scope                      | Access granted                                   |
| -------------------------- | ------------------------------------------------ |
| `emails/schedule.readonly` | Read scheduled campaigns and campaign statistics |
| `emails/builder.readonly`  | Read email templates                             |
| `emails/builder.write`     | Create, update, and delete email templates       |

## Quick start

Fetch all email templates for a location:

```bash theme={null}
curl -X GET "https://services.leadconnectorhq.com/emails/builder?locationId=<locationId>&limit=10&offset=0" \
  -H "Authorization: Bearer <access_token>" \
  -H "Version: 2021-07-28"
```

## Endpoints

| Method   | Path                                                      | Description                     |
| -------- | --------------------------------------------------------- | ------------------------------- |
| `GET`    | `/emails/schedule`                                        | Get campaigns                   |
| `POST`   | `/emails/builder`                                         | Create a new template           |
| `GET`    | `/emails/builder`                                         | Fetch email templates           |
| `POST`   | `/emails/builder/data`                                    | Update a template               |
| `DELETE` | `/emails/builder/{locationId}/{templateId}`               | Delete a template               |
| `PATCH`  | `/emails/builder/{templateId}`                            | Update a template with settings |
| `GET`    | `/emails/stats/location/{locationId}/{source}/{sourceId}` | Get campaign statistics         |
| `GET`    | `/emails/campaigns/workflows`                             | Get workflow campaigns          |
| `GET`    | `/emails/campaigns/bulk-actions`                          | Get bulk action campaigns       |

## Related

* [OAuth 2.0 overview](/api-reference/oauth/overview)
* [Campaigns API overview](/api-reference/campaigns/overview)
* [Contacts API overview](/api-reference/contacts/overview)
