Primeros pasos

Inicio rápido

Cree una clave, verifique un dominio y envíe un correo controlado con una solicitud segura ante reintentos.

Antes de empezar

Create a SendHQ workspace and keep the dashboard open. You can verify a domain and create an API key before paying. Sending requires an active subscription: there is no free allowance, including to your own address. Choose a plan at pricing.

1. Crear una clave de API

Abra API keys en el panel, elija un nombre descriptivo como Production y copie la clave cuando se muestre. Guárdela en un gestor de secretos del lado del servidor. SendHQ nunca vuelve a mostrar el valor completo.

.env
SENDHQ_API_KEY=re_your_key_here

2. Agregar un dominio de envío

Open Domains, add a domain you control, and publish the returned DKIM, SPF, DMARC, and domain verification records. Copy the records into your DNS host and click Verify. On Cloudflare, add them as DNS only (grey cloud). Add the records, then click Verify.

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. Esperar la verificación

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

4. Enviar un mensaje controlado

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 solicitud correcta devuelve un ID de correo de SendHQ, el ID de mensaje del proveedor y el ID del hilo de la conversación. Guarde el ID de SendHQ junto con el evento de la aplicación que originó el correo.

5. Gestionar los resultados

Una solicitud aceptada por la API no equivale a la entrega al destinatario. Consulte /emails/:id/events o use el panel para inspeccionar los eventos de entrega, rebote, queja, rechazo, apertura y clic.