Email sending endpoints for sending invoices and documents. Automatically includes company logo from entity settings, generates public shareable invoice links, and optionally attaches PDFs.
Send email with optional PDF attachment
/email/sendSend an email with automatic company logo and optional document attachment. When a document_id is provided, a public shareable link is automatically generated and can be included in the email body using the {invoice_link} variable. If the variable is not used, the link is appended to the body. The PDF attachment is opt-in via attach_pdf flag (default: false). Email body supports markdown formatting and template variables like {document_number}, {customer_name}, {entity_name}, {invoice_link}, etc.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Recipient email address
curl -X POST "https://eu.spaceinvoices.com/email/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"to": "customer@example.com",
"document_id": "inv_2024_001"
}'Returns
{
"message_id": "0000014d-3f45-4d2b-b470-0c8b9d1a4d6b@us-east-1.amazonses.com",
"status": "sent",
"to": "customer@example.com",
"subject": "Invoice from Acme Corp",
"shareable_link": "http://localhost:3001/documents/shareable/inv_share_abc123..."
}Send document via email
/documents/{id}/sendSend a document via email. Automatically generates a public shareable link and optionally attaches the PDF. Supports markdown formatting and template variables in the email body.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Document ID
Body parameters
Recipient email address
curl -X POST "https://eu.spaceinvoices.com/documents/{id}/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"to": "customer@example.com"
}'Returns
{
"message_id": "01234567-89ab-cdef-0123-456789abcdef",
"status": "sent",
"to": "customer@example.com",
"subject": "Invoice #2025-001",
"shareable_link": "https://app.example.com/share/abc123"
}