Email Delivery

POST/v1/invoicePOST/v1/receiptPOST/v1/quotePOST/v1/credit-notePOST/v1/packing-slipPOST/v1/timesheet

Send generated PDFs directly to your clients via email. Add deliver_to to any API request.

How it works

  1. 1. Add a deliver_to object to any request body.
  2. 2. The PDF is generated and emailed as an attachment to the specified recipients.
  3. 3. The API still returns the PDF binary — same as without deliver_to.
  4. 4. A X-Kagyz-Delivered-To response header confirms delivery.

The deliver_to field

FieldTypeRequiredDescription
deliver_to.emailstring | string[]YesRecipient email(s). Max 5.
deliver_to.ccstring[]NoCC recipients. Max 3.
deliver_to.subjectstringNoEmail subject. Auto-generated if omitted (max 200 chars).
deliver_to.messagestringNoPlain text body. Auto-generated if omitted (max 2000 chars).

Auto-generated defaults

When subject is omitted, Kagyz generates one based on the document type:

Document TypeDefault Subject
InvoiceInvoice {number} from {from.name}
ReceiptReceipt {number} from {from.name}
QuoteQuote {number} from {from.name}
Credit NoteCredit Note {number} from {from.name}
Packing SlipPacking Slip {number} from {from.name}
TimesheetTimesheet {number} from {from.name}

Default message

When message is omitted:

Hi,

Please find the attached {document_type}.

Best regards,
{from.name}

Important notes

  • from.email is required when using deliver_to — replies go to this address.
  • Emails are sent from "{from.name} via Kagyz" <noreply@kagyz.com>
  • Reply-To is set to from.email.

Rate limits

PlanLimit
Free5 emails/day
Starter50 emails/day
Growth100 emails/day

Example

bash
curl -X POST https://api.kagyz.com/v1/invoice \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "INV-001",
"issue_date": "Mar 19, 2026",
"currency": "USD",
"from": { "name": "Acme Corp", "email": "billing@acme.com" },
"to": { "name": "Client Inc." },
"items": [{ "description": "Consulting", "quantity": 10, "unit_price": 150 }],
"deliver_to": {
"email": "client@example.com",
"subject": "Invoice INV-001 from Acme Corp",
"message": "Hi,\n\nPlease find your invoice attached.\n\nThank you,\nAcme Corp"
}
}' \
--output invoice.pdf

Response

Success (200)

  • Content-Type: application/pdf
  • Body: PDF binary data
  • Header: X-Kagyz-Delivered-To: client@example.com

Errors

StatusBody
400{ "error": "deliver_to.email is required" }
401{ "error": "Invalid API key" }
429{ "error": "Email rate limit reached. Please upgrade." }

Invoice API docs →

Receipt API docs →

Quote API docs →

Credit Note API docs →

Packing Slip API docs →

Timesheet API docs →