---
title: REST API overview
project: OpenMail
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/openmail/1-0/reference/rest-api/
updated: 2026-11-19T07:58:08.081Z
---

# REST API overview

> The endpoints your apps call, how to send the token and what comes back.

Your apps talk to OpenMail over HTTP. Every address starts with your OpenMail address, for example `https://mail.example.com`.

## Endpoints

| Method and path | What it does |
|---|---|
| `POST /` | [Send an email](../send-email/) with a template. |
| `GET /profiles/` | [List the profiles and templates](../list-profiles/). |

## Send the token

Every request needs an [API token](../../guides/api-tokens/). Send it in one of two ways:

- in the `x-token` header:

```bash
curl -H "x-token: YOUR_TOKEN" -H "content-type: application/json" \
  -d '{"id":"demo/welcome","to":"jane@example.com","data":{"name":"Jane Doe","plan":"Pro"}}' \
  https://mail.example.com/
```

- or as the `token` query argument:

```bash
curl -H "content-type: application/json" \
  -d '{"id":"demo/welcome","to":"jane@example.com","data":{"name":"Jane Doe","plan":"Pro"}}' \
  "https://mail.example.com/?token=YOUR_TOKEN"
```

The header keeps the token out of server logs, so prefer it when your app can set headers.

## Request formats

`POST /` accepts JSON (`application/json`) and `multipart/form-data`. Use multipart when you want to upload files as attachments. See [Attachments](../attachments/).

## What comes back

A successful request answers `200`:

```json
{"success":true}
```

Errors come back as a JSON array, for example:

```json
[{"error":"Template not found"}]
```

See [Errors](../errors/).
