Skip to content

Email

Email

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

POST/email/send

Send 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_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

tostring<email>required

Recipient email address

Other parameters
subjectstringoptional
body_textstringoptional
document_idstringoptional
attach_pdfbooleanoptional
attach_eslogbooleanoptional
sandbox_skip_deliverybooleanoptional
localestringoptional
languageoptional
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"
  }'
Example:

Returns

message_idstring
statusstring
tostring<email>
subjectstring
shareable_linkstring<uri>
sandbox_skip_deliveryboolean
json
{
  "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..."
}
Example:

Send document via email

POST/documents/{id}/send

Send 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_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Body parameters

tostring<email>required

Recipient email address

Other parameters
subjectstringoptional
body_textstringoptional
attach_pdfbooleanoptional
attach_eslogbooleanoptional
sandbox_skip_deliverybooleanoptional
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"
  }'
Example:

Returns

message_idstring
statusstring
tostring<email>
subjectstring
shareable_linkstring<uri>
sandbox_skip_deliveryboolean
json
{
  "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"
}