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 documentId 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 attachPdf 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. Optional - defaults to the first created entity if not provided.

Body parameters

tostring<email>required

Recipient email address

Other parameters
subjectstringoptional
bodyTextstringoptional
documentIdstringoptional
attachPdfbooleanoptional
attachEslogbooleanoptional
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",
    "documentId": "inv_2024_001"
  }'
Example:

Returns

messageIdstring
statusstring
tostring<email>
subjectstring
shareableLinkstring<uri>
json
{
  "messageId": "0000014d-3f45-4d2b-b470-0c8b9d1a4d6b@us-east-1.amazonses.com",
  "status": "sent",
  "to": "customer@example.com",
  "subject": "Invoice from Acme Corp",
  "shareableLink": "http://localhost:3001/documents/shareable/inv_share_abc123..."
}
Example: