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

# Panoramica della REST API

> Gli endpoint che chiamano le tue app, come inviare il token e cosa torna indietro.

Le tue app parlano con OpenMail tramite HTTP. Ogni indirizzo inizia con l'indirizzo del tuo OpenMail, per esempio `https://mail.example.com`.

## Endpoint

| Metodo e percorso | Cosa fa |
|---|---|
| `POST /` | [Invia un'email](../send-email/) con un template. |
| `GET /profiles/` | [Elenca i profili e i template](../list-profiles/). |

## Inviare il token

Ogni richiesta ha bisogno di un [token API](../../guides/api-tokens/). Invialo in uno di due modi:

- nell'header `x-token`:

```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/
```

- oppure come parametro di query `token`:

```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"
```

L'header tiene il token fuori dai log del server, quindi preferiscilo quando la tua app può impostare gli header.

## Formati della richiesta

`POST /` accetta JSON (`application/json`) e `multipart/form-data`. Usa multipart quando vuoi caricare file come allegati. Leggi [Allegati](../attachments/).

## Cosa torna indietro

Una richiesta riuscita risponde `200`:

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

Gli errori tornano come array JSON, per esempio:

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

Leggi [Errori](../errors/).
