API / Messaging

POST

/emails

Enqueue a transactional email

Authentification : clé API Bearer requise.

Paramètres

NomDansTypeDescription
Idempotency-KeyheaderstringUnique retry key kept for 24 hours

Corps JSON

Email to send

NomTypeDescription
fromstring—
htmlstring—
identityIdstringIdentityID 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.
localestring—
subjectstring—
templatestring—
textstring—
toarray<string>—
unsubscribesend_email.UnsubscribeOptions—
variablesrecord<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

StatutDescriptionType
202Acceptedsend_email.SendEmailResult
400Bad Requestecho.HTTPError
401Unauthorizedecho.HTTPError
403api key is scoped to another identityecho.HTTPError
422monthly email quota reachedsend_email.QuotaErrorBody
429Too Many Requestsecho.HTTPError

Source machine : openapi.json · opération sendEmail