---
title: Messaggi
project: Total API
version: 2026
section: reference
language: it
license: 
url: https://totaljs.es/docs/it/total-api/2026/reference/messages/
updated: 2026-11-20T06:51:47.968Z
---

# Messaggi

> Invia email e SMS e salva messaggi di log.

Ogni servizio è una richiesta `POST` con il tuo token. Leggi [Chiamare Total API da Total.js](../../guides/call-from-totaljs/) e [Chiamare Total API via HTTP](../../guides/call-over-http/).

## API

### POST https://api.totaljs.com/mail/

Type: `rest`

Invia un'email.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `to` | `Array` | yes |  | Gli indirizzi email dei destinatari. |
| `subject` | `String` | yes |  | L'oggetto. |
| `body` | `String` | yes |  | Il messaggio in HTML. |
| `from` | `String` | no |  | Il nome del mittente (un nome, non un indirizzo email). |
| `cc` | `Array` | no |  | Indirizzi email per una copia. |
| `bcc` | `Array` | no |  | Indirizzi email per una copia nascosta. |
| `reply` | `Array` | no |  | Indirizzi email per le risposte. |
| `priority` | `Number` | no | `3` | `1` alta, `3` normale, `5` bassa. |
| `confidential` | `Boolean` | no |  | Segna l'email come riservata. |
| `unsubscribe` | `String` | no |  | L'indirizzo di una pagina per annullare l'iscrizione. |

Returns: `Object` `{ "success": true }` quando l'email è stata inviata.

Le email vengono inviate da `noreply@totaljs.com`. Un'applicazione Total.js può inviare tutte le sue email tramite questo servizio: leggi [Chiamare Total API da Total.js](../../guides/call-from-totaljs/#send-the-emails-of-the-app-through-total-api).

Example: Total.js
```js
await API('TAPI', 'mail', { from: 'Demo Shop', to: ['jane@example.com'], subject: 'Your order', body: '<p>Thank you for your order.</p>' }).promise();
```

Example: REST
```bash
curl -X POST https://api.totaljs.com/mail/ \
	-H "Content-Type: application/json" \
	-H "X-Token: YOUR_TOKEN" \
	-d '{ "from": "Demo Shop", "to": ["jane@example.com"], "subject": "Your order", "body": "<p>Thank you for your order.</p>" }'
```

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

### POST https://api.totaljs.com/sms/

Type: `rest`

Invia un SMS.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `from` | `String` | yes |  | Il nome del mittente. |
| `to` | `String` | yes |  | Il numero di telefono con il prefisso internazionale, per esempio `+421900000000`. |
| `body` | `String` | yes |  | Il messaggio. |

Returns: `Object` `{ "success": true }` quando il messaggio è stato inviato.

Il prezzo di un messaggio può variare.

Example: Total.js
```js
await API('TAPI', 'sms', { from: 'Demo Shop', to: '+421900000000', body: 'Your order is on its way.' }).promise();
```

Example: REST
```bash
curl -X POST https://api.totaljs.com/sms/ \
	-H "Content-Type: application/json" \
	-H "X-Token: YOUR_TOKEN" \
	-d '{ "from": "Demo Shop", "to": "+421900000000", "body": "Your order is on its way." }'
```

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

### POST https://api.totaljs.com/logger/

Type: `rest`

Salva un messaggio di log nella Total.js Platform.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `app` | `String` | yes |  | Il nome dell'applicazione, fino a 40 caratteri. |
| `message` | `String` | yes |  | Il messaggio, fino a 500 caratteri. |
| `type` | `String` | no | `info` | `info`, `warning`, `error` o `success`. |
| `url` | `String` | no |  | Un indirizzo, fino a 100 caratteri. |
| `reference` | `String` | no |  | Un tuo riferimento, fino a 50 caratteri. |
| `data` | `String` | no |  | Dati tuoi come testo JSON. |
| `ua` | `String` | no |  | Lo user agent, fino a 30 caratteri. |
| `ip` | `String` | no |  | L'indirizzo IP, fino a 60 caratteri. |
| `userid` | `String` | no |  | L'id dell'utente, fino a 25 caratteri. |
| `username` | `String` | no |  | Il nome dell'utente, fino a 50 caratteri. |

Returns: `Object` La risposta del servizio.

Una richiesta può pesare fino a 50 kB. Un'applicazione Total.js può inviare tutti i suoi log di audit a questo servizio: leggi [Chiamare Total API da Total.js](../../guides/call-from-totaljs/#send-the-audit-logs-to-total-api).

Example: Total.js
```js
await API('TAPI', 'logger', { app: 'Demo Shop', type: 'info', message: 'The daily import has finished.' }).promise();
```

Example: REST
```bash
curl -X POST https://api.totaljs.com/logger/ \
	-H "Content-Type: application/json" \
	-H "X-Token: YOUR_TOKEN" \
	-d '{ "app": "Demo Shop", "type": "info", "message": "The daily import has finished." }'
```
