Documentación API
API REST compatible con SendGrid para envío de emails transaccionales.
URL Base:
https://chorizo.online
POST
/v3/mail/send
202
Envía un email usando el formato de payload compatible con SendGrid.
curl -X POST https://chorizo.online/v3/mail/send \
-H "Authorization: Bearer SG.your-api-key" \
-H "Content-Type: application/json" \
-d '{
"personalizations": [
{
"to": [{"email": "user@example.com", "name": "User"}],
"subject": "Hello World"
}
],
"from": {"email": "noreply@yourdomain.com", "name": "My App"},
"content": [
{"type": "text/plain", "value": "Hello!"},
{"type": "text/html", "value": "<h1>Hello!</h1>"}
]
}'
POST
/v3/bounce
200
Procesa notificaciones de rebote y agrega destinatarios a la lista de supresión.
curl -X POST https://chorizo.online/v3/bounce \
-H "Content-Type: application/json" \
-d '{
"recipients": ["bounced@example.com"],
"reason": "Mailbox not found"
}'
GET
/v3/stats
200
Obtiene estadísticas de envío para un período de tiempo.
| Parameter | Type | Description |
|---|---|---|
| days | int | Días a consultar (1-365, por defecto 30) |
| domain_id | int | Filtrar por dominio (opcional) |
curl "https://chorizo.online/v3/stats?days=7" \
-H "Authorization: Bearer SG.your-api-key"
POST
/v3/templates
201
Crea una nueva plantilla de email.
curl -X POST https://chorizo.online/v3/templates \
-H "Authorization: Bearer SG.your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "welcome",
"subject": "Welcome, !",
"html_content": "<h1>Hello </h1><p>Welcome aboard.</p>"
}'
GET
/v3/templates
200
Lista todas las plantillas de la clave API autenticada.
curl "https://chorizo.online/v3/templates" \
-H "Authorization: Bearer SG.your-api-key"
GET
/v3/templates/{template_id}
200
Obtiene una plantilla por ID.
curl "https://chorizo.online/v3/templates/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer SG.your-api-key"
PATCH
/v3/templates/{template_id}
200
Actualiza una plantilla por ID. Solo envía los campos que quieras cambiar.
curl -X PATCH https://chorizo.online/v3/templates/550e8400-... \
-H "Authorization: Bearer SG.your-api-key" \
-H "Content-Type: application/json" \
-d '{"subject": "Updated subject"}'
DELETE
/v3/templates/{template_id}
204
Elimina una plantilla por ID.
curl -X DELETE https://chorizo.online/v3/templates/550e8400-... \
-H "Authorization: Bearer SG.your-api-key"
Códigos de Respuesta
200
Éxito
201
Creado
202
Aceptado para entrega
204
Eliminado (sin contenido)
400
Payload de solicitud inválido
401
Clave API inválida o faltante
403
Destinatario bloqueado por reglas ACL
404
Recurso no encontrado
409
Conflicto (nombre duplicado)
429
Límite de peticiones excedido