Per iniziare

Guida rapida

Crea una chiave, verifica un dominio e invia un'email controllata con una richiesta sicura da ritentare.

Prima di iniziare

Create a SendHQ workspace and keep the dashboard open. New workspaces receive a controlled integration trial: deliveries can go only to the account email or a mailbox-simulator test address until a paid subscription is active.

1. Crea una chiave API

Apri Chiavi API nella dashboard, scegli un nome descrittivo come Production e copia la chiave quando viene mostrata. Conservala in un secret manager lato server. SendHQ non restituisce mai più il valore completo.

.env
SENDHQ_API_KEY=re_your_key_here

2. Aggiungi un dominio di invio

Open Domains, add a domain you control, and publish the returned DKIM, SPF, DMARC, and domain verification records. Cloudflare users can authorize a one-time DNS setup; SendHQ discards the OAuth token after the callback.

Do not publish a second SPF policy.If SPF already exists, merge SendHQ's SPF include (include:amazonses.com) into the existing v=spf1 value.

3. Attendi la verifica

Use the dashboard or POST /domains/:id/verify. DNS can move through pending, checking, and propagating before the sending identity is verified.

4. Invia un messaggio controllato

curl
curl https://sendhq.cc/api/v1/emails \
  -H "Authorization: Bearer $SENDHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: onboarding-user-42" \
  -d '{"from":"Acme <hello@example.com>","to":["owner@example.com"],"subject":"SendHQ is connected","html":"<h1>It works</h1><p>Your first controlled message was accepted.</p>","text":"It works. Your first controlled message was accepted."}'

Una richiesta riuscita restituisce l'ID email SendHQ, l'ID messaggio del provider e l'ID del thread della conversazione. Salva l'ID SendHQ insieme all'evento applicativo che ha generato l'email.

5. Gestisci gli esiti

Una richiesta API accettata non equivale alla consegna al destinatario. Recupera /emails/:id/events o usa la dashboard per consultare gli eventi di consegna, bounce, segnalazione di spam, rifiuto, apertura e clic.