MakiSendAPI referenceOpenAPIGitHub

MakiSend API reference: send email, templates and logs

POST /send-email and the email endpoints of a self-hosted MakiSend instance: authentication, inline or template payloads, attachments, responses and logs.

Base URL: your own instance, https://your-instance.workers.dev. Authenticate withAuthorization: Bearer <api-key> or x-api-key. The full document is at/openapi.json.

This page in Markdown: /api.md.

POST /send-email

Queue a transactional email. Accepts either inline content (subject, text, html) or a templateId plus variables. The two shapes are mutually exclusive. HTML is sanitized before delivery. Send the optional Idempotency-Key header to make retries safe.

Auth: API key: Authorization: Bearer <api-key> or x-api-key: <api-key>.

Parameters

NameIn, typeRequiredNotes
Idempotency-Keyheader, stringno1 to 255 characters. Optional unique key for safe retries. Replaying the same key and body returns the stored response for 24 hours; reusing it with a different body returns 409

Request body

Inline email content, or a template reference. The shapes are mutually exclusive.

Inline content

FieldTypeRequiredNotes
tostring (email)yesAt most 320 characters
subjectstringyes3 to 500 characters
textstringyes10 to 20000 characters
htmlstringyes1 to 100000 characters
attachmentsarray of objectnoAt most 5 items. Each item: filename, content, content_type (optional)

From a saved template

FieldTypeRequiredNotes
tostring (email)yesAt most 320 characters
templateIdstringyes1 to 128 characters
variablesobjectnoValues: string | number | boolean
attachmentsarray of objectnoAt most 5 items. Each item: filename, content, content_type (optional)

Responses

  • 202: Email persisted and queued for asynchronous delivery.
  • 400: Request validation failed.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: The referenced template does not exist for this account.
  • 409: Idempotency key conflict.
  • 429: Only when the instance sets SEND_RATE_LIMIT: this API key reached its send quota. Retry-After gives the seconds until the window restarts.
  • 500: Unexpected server error.

GET /email-logs

List email logs. Newest first, cursor-paginated. The recipient filter is applied to the decrypted current page, so a page can contain fewer rows than limit when filtering by to.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
smtpConfigIdquery, stringnoAt most 128 characters. The emails sent with this configuration's keys, plus its test sends
apiKeyIdquery, stringnoAt most 128 characters. Only the emails sent with this API key
toquery, stringnoAt most 320 characters. Case-insensitive substring match on the decrypted recipient
statusquery, stringnoOne of received, processing, cleaned, sent, failed
limitquery, integerno1 to 100. Default 50
cursorquery, stringnoAt most 512 characters. Opaque nextCursor from the previous page

Responses

  • 200: Page of email logs with their history.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 500: Unexpected server error.

GET /email-logs/{id}

Get an email log.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
idpath, stringyes1 to 128 characters. Resource identifier

Responses

  • 200: Email log with its full history.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: Resource not found.
  • 500: Unexpected server error.

GET /templates

List templates.

Auth: Dashboard session (sign in to your instance first).

Responses

  • 200: Templates owned by the session user.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 500: Unexpected server error.

POST /templates

Create a template. Use {{variable}} placeholders in the subject, HTML, or text. Variables are supplied at send time.

Auth: Dashboard session (sign in to your instance first).

Request body

New reusable email template.

JSON body

FieldTypeRequiredNotes
namestringyes1 to 100 characters
subjectstringyes1 to 500 characters
formatstringnoOne of legacy, react-email, react-email-code. Default legacy
editorJsonstringno2 to 250000 characters
sourcestringno1 to 100000 characters
htmlstringyes1 to 100000 characters
textstringyes1 to 20000 characters

Responses

  • 201: Template created.
  • 400: Request validation failed.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 500: Unexpected server error.

GET /templates/{id}

Get a template.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
idpath, stringyes1 to 128 characters. Resource identifier

Responses

  • 200: Template.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: Resource not found.
  • 500: Unexpected server error.

PUT /templates/{id}

Update a template.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
idpath, stringyes1 to 128 characters. Resource identifier

Request body

Partial template update.

JSON body

FieldTypeRequiredNotes
namestringno1 to 100 characters
subjectstringno1 to 500 characters
formatstringnoOne of legacy, react-email, react-email-code
editorJsonobjectno
sourceobjectno
htmlstringno1 to 100000 characters
textstringno1 to 20000 characters

Responses

  • 200: Template updated.
  • 400: Request validation failed.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: Resource not found.
  • 500: Unexpected server error.

DELETE /templates/{id}

Delete a template.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
idpath, stringyes1 to 128 characters. Resource identifier

Responses

  • 200: Template deleted.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: Resource not found.
  • 500: Unexpected server error.

POST /templates/{id}/preview

Preview a template. Renders the saved subject, HTML, and text with the supplied variables. Missing variables, line breaks, and length limits are reported exactly as they would be by POST /send-email.

Auth: Dashboard session (sign in to your instance first).

Parameters

NameIn, typeRequiredNotes
idpath, stringyes1 to 128 characters. Resource identifier

Request body

Variable values used to render a saved template preview.

JSON body

FieldTypeRequiredNotes
variablesobjectnoValues: string | number | boolean

Responses

  • 200: Rendered template preview.
  • 400: Request validation failed.
  • 401: Missing or invalid credentials.
  • 403: Credentials are valid but the resource is not accessible.
  • 404: Resource not found.
  • 500: Unexpected server error.