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

# Send an Email Template by API

> List your email templates and send one to up to 25 addresses with your own values.

## What is this?

The workspace API can list your email templates and send one directly, for example an order confirmation or a change log. Each address is found or created as a contact, and the email is sent through your channel's sender. No campaign is created, and the email is saved in that contact's email conversation in the [Inbox](https://docs.wappigate.com/workspace/email/inbox.md).

> [!NOTE]
>
> Calls use a workspace API key and count against your plan's monthly email quota. See [Developer Portal](https://docs.wappigate.com/workspace/developer-portal.md) for keys, and the API reference for the exact endpoints.

## What can I do here?

* **List email templates** and the variables each one takes
* **Send an email template** to one address or a comma-separated list of up to 25
* Fill the template's own variables with values you send
* Send a list value (such as a change log) as one item per line

## How to use it

### 1. Find the variables a template takes

**List email templates** returns your templates and, for each, its variables with a source:

| Source | Who fills it |
| - | - |
| `contact` or `custom` | The contact's own data, such as `contact.firstName` or `custom.city` |
| `system` | The platform (the unsubscribe link) — never send it |
| `api` | You, in the send call |

A variable with a fallback, such as `{{order_id|your order}}`, may be left out. One without a fallback must be sent.

### 2. Send the template

Name the template with `templateName` (case doesn't matter) or `templateId` (use it when two templates share a name). Send **to** an address, or several separated by commas, semicolons or spaces. Optional fields: `subject` (replaces the template's subject, one line up to 300 characters), `senderId` (a sender; the channel default when omitted) and `channelId`. Pass **variables** as a JSON object:

```json theme={null}
{ "order_id": "A-1001", "changelog": ["Faster search", "New export"] }
```

* A value is a text, a number, true/false, or a list of those
* A list becomes one item per line. Set `listStyle` to `plain`, `numbers` (1. A) or `dots` (• A)
* A text can contain line breaks, each shown as a new row

The answer gives totals (`recipients`, `sent`, `skipped`, `failed`) and a result for each address: `sent` with a `messageId`, or `skipped` with a reason such as `suppressed`.

### Limits

| Limit | Value |
| - | - |
| Send calls | 20 requests per minute per API user |
| Addresses per call | 25 |
| Variables per call | 50 |
| Characters in one value | 2,000 |
| Items in a list value | 100, up to 10,000 characters in all |
| Variable name | Letters, numbers, `_` and `.`, up to 60 characters |

## Troubleshooting / Technical Notes

* **An address came back `skipped`.** It unsubscribed, bounced, complained, or hasn't confirmed a double opt-in. The sender's daily limit and the monthly quota also apply.
* **"variables must be a JSON object."** In a GET request, pass variables as JSON text, for example `{"order_id":"A-1001"}`.
* **A required variable is missing.** The call names the variables the template needs. Send them or add a fallback in the template.
* **"…is not a variable name you can send."** Names use letters, numbers, `_` and `.`; `unsubscribe_url` is filled by the platform.
* **The unsubscribe link is always included.**

## Related docs

* [Email Templates](https://docs.wappigate.com/workspace/email/templates.md)
* [Email Marketing](https://docs.wappigate.com/workspace/email/overview.md)
* [Developer Portal](https://docs.wappigate.com/workspace/developer-portal.md)
* [API introduction](https://docs.wappigate.com/api-reference/introduction.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.