API / Messaging
POST
/emails
Enqueue a transactional email
Authentification : clé API Bearer requise.
Paramètres
| Nom | Dans | Type | Description |
|---|---|---|---|
| Idempotency-Key | header | string | Unique retry key kept for 24 hours |
Corps JSON
Email to send
| Nom | Type | Description |
|---|---|---|
| from | string | — |
| html | string | — |
| identityId | string | IdentityID is optional and deprecated. When omitted, the server resolves the identity from the domain of the From address — match the industry baseline (Resend, SES, Postmark). When provided, it must agree with the From domain; otherwise the request is rejected. |
| locale | string | — |
| subject | string | — |
| template | string | — |
| text | string | — |
| to | array<string> | — |
| unsubscribe | send_email.UnsubscribeOptions | — |
| variables | record<string, string> | — |
Exemple curl
curl -X POST https://api.sporee.fr/emails \
-H "Authorization: Bearer $SPORE_API_KEY" \
-H "Idempotency-Key: <uuid>" \
-H "Content-Type: application/json" \
-d '{
"from": "hello@votredomaine.fr",
"html": "<p>Votre compte est prêt.</p>",
"subject": "Bienvenue",
"to": [
"alex@example.com"
]
}'Réponses
| Statut | Description | Type |
|---|---|---|
| 202 | Accepted | send_email.SendEmailResult |
| 400 | Bad Request | echo.HTTPError |
| 401 | Unauthorized | echo.HTTPError |
| 422 | monthly email quota reached | send_email.QuotaErrorBody |
| 429 | Too Many Requests | echo.HTTPError |
Source machine : openapi.json · opération sendEmail