Template variables for personalization. Maximum 100 properties allowed.
Variables are referenced in templates using double curly braces: {{variable_name}}
Note: When using templates with variables (e.g., {{variable_name}}):
Default values can be defined in the template
Values provided through this API field will override any template defaults
Default values will be used when:
The variable is not provided at all
The variable is explicitly set to null
When using object format and value is null or undefined
Each variable can be:
A string
A number
An object with:
value: string, number, or null
default: string or number (used when value is null)
File attachments. You can attach files using either base64 encoded content or a URL path.
Limits:
Maximum 10 attachments allowed
Total size must not exceed 40MB for all attachments combined
Each attachment must have:
filename (required)
Either path OR content (one must be provided)
content_type (optional, but highly recommended)
If not provided, falls back to application/octet-stream
Tip: You can upload files through the "Assets" in the template page.
These files will be served through our CDN, ensuring they are cached and optimized for delivery.
{"docsConfig":{"theme":"willow","$schema":"https://mintlify.com/docs.json","name":"MailDiver","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/selfmailkit/flS_Fi6hXDlFtHex/logo/light.svg?fit=max\u0026auto=format\u0026n=flS_Fi6hXDlFtHex\u0026q=85\u0026s=0023f9f8bf0e7cb7c2ba1ce8f3da8fe2","dark":"https://mintcdn.com/selfmailkit/flS_Fi6hXDlFtHex/logo/dark.svg?fit=max\u0026auto=format\u0026n=flS_Fi6hXDlFtHex\u0026q=85\u0026s=a79aec5148d2d6e69f049c332a98557e"},"favicon":"/favicon.svg","api":{"playground":{"display":"none"}},"navbar":{"links":[{"label":"Support","href":"mailto:support@maildiver.com"},{"label":"Releases","href":"https://maildiver.com/releases"}],"primary":{"type":"button","label":"Dashboard","href":"https://maildiver.com"}},"footer":{"socials":{"github":"https://github.com/maildiver","linkedin":"https://linkedin.com/company/maildiver"}},"navigation":{"global":{"anchors":[{"anchor":"Api Reference","icon":"slack","href":"https://docs.maildiver.com/api-reference/introduction"},{"anchor":"Help","icon":"question","href":"https://maildiver.com/help"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"selfmailkit","hasAudioNarration":false,"actualSubdomain":"selfmailkit","customDomains":["docs.maildiver.com"],"gitSource":{"type":"github","owner":"self-mail-kit","repo":"self-mail-kit-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a20c7a0b7c442096901f40e","collectionId":"e93a9085-ff04-4bd8-8a04-8f8c3020decc","schemaVersion":"v2"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae925d185770375310412da:success","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API Reference","count":31},{"language":"default","tag":"Self-Hosted","count":6},{"language":"default","tag":"How to Deploy","count":5},{"language":"default","tag":"Automation Contact","count":5},{"language":"default","tag":"Contact","count":5},{"language":"default","tag":"Knowledge","count":4},{"language":"default","tag":"Managed (Cloud)","count":4},{"language":"default","tag":"Audience","count":4},{"language":"default","tag":"Automation Execution","count":4},{"language":"default","tag":"Automation Workflow","count":4}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/email/send-email","slug":"/api-reference/email/send-email","pageMetadata":{"title":"Send email","description":"**Endpoint:** `v1/emails`\n\nSend a transactional email with optional template, attachments, and variables\n","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /emails","href":"/api-reference/email/send-email","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Endpoint:\"\n }), \" \", _jsx(_components.code, {\n children: \"v1/emails\"\n })]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Send a transactional email with optional template, attachments, and variables\"\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Send email","description":"**Endpoint:** `v1/emails`\n\nSend a transactional email with optional template, attachments, and variables\n","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /emails","href":"/api-reference/email/send-email","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Send email","description":"**Endpoint:** `v1/emails`\n\nSend a transactional email with optional template, attachments, and variables\n","operationId":"sendEmail","tags":["Email"],"requestBody":"c057415c-5614-4d35-8a37-b3f59d073a73","responses":{"201":"6f695f0c-fe58-4e4f-a500-de7d4ae2a02d","400":"c3a4cfa1-c82b-4f1d-9fcb-718f65b523cb","403":"0174851b-36c9-4d1d-821c-c816e1366699","404":"ec4decc4-9e54-43b0-8a09-5d0efefcc314"},"method":"post","type":"path","servers":["1f27b192-a1af-46ae-b65f-2e32c68f5321"],"security":["9acad2cd-422e-4da5-ace4-7df668ae50e7"],"path":"/emails","baseUrlOptions":["https://api.maildiver.com/v1"],"title":"Send email","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to","subject"],"properties":{"from":{"type":"string","description":"Sender email address. Must be in one of these formats:\n- `\"Name\" \u003cemail@domain.com>`\n- `Name \u003cemail@domain.com>`\n- `email@domain.com`\n","maxLength":100,"example":"Your Name \u003csender@yourdomain.com>","isRequired":true,"uniqueKey":"from","typeLabel":"string"},"to":{"oneOf":[{"type":"string","description":"Recipient email addresses. Maximum 50 recipients allowed.","example":"recipient@example.com","isRequired":true,"uniqueKey":"to.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"to.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Recipient email addresses. Maximum 50 recipients allowed.","maxItems":50,"example":["recipient1@example.com","recipient2@example.com"],"isRequired":true,"uniqueKey":"to.oneOf.1","typeLabel":"string[]"}],"isRequired":true,"uniqueKey":"to","typeLabel":"string | string[]"},"subject":{"type":"string","description":"Email subject line","maxLength":100,"example":"Welcome to Our Service!","isRequired":true,"uniqueKey":"subject","typeLabel":"string"},"html":{"type":"string","description":"HTML content of the email. Required if `template_id` is not provided.\n- Maximum size: 40MB\n- Cannot be used together with `template_id`\n","example":"\u003cp>Hello {{name}}!\u003c/p>","uniqueKey":"html","typeLabel":"string"},"template_id":{"type":"string","description":"ID of the email template. Required if `html` is not provided.\n- Cannot be used together with `html`\n- Must reference an existing template\n- Template must have valid HTML content\n","example":"welcome-template","uniqueKey":"template_id","typeLabel":"string"},"text":{"type":"string","description":"Plain text version of the email. Maximum size 10MB.","example":"Hello {{name}}!","uniqueKey":"text","typeLabel":"string"},"cc":{"oneOf":[{"type":"string","description":"CC recipient addresses. Maximum 50 recipients allowed.","example":"cc@example.com","uniqueKey":"cc.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"cc.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"CC recipient addresses. Maximum 50 recipients allowed.","maxItems":50,"example":["cc1@example.com","cc2@example.com"],"uniqueKey":"cc.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"cc","typeLabel":"string | string[]"},"bcc":{"oneOf":[{"type":"string","description":"BCC recipient addresses. Maximum 50 recipients allowed.","example":"bcc@example.com","uniqueKey":"bcc.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"bcc.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"BCC recipient addresses. Maximum 50 recipients allowed.","maxItems":50,"example":["bcc1@example.com","bcc2@example.com"],"uniqueKey":"bcc.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"bcc","typeLabel":"string | string[]"},"reply_to":{"oneOf":[{"type":"string","description":"Reply-to addresses. Maximum 50 recipients allowed.","example":"reply@yourdomain.com","uniqueKey":"reply_to.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"reply_to.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Reply-to addresses. Maximum 50 recipients allowed.","maxItems":50,"example":["reply1@yourdomain.com","reply2@yourdomain.com"],"uniqueKey":"reply_to.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"reply_to","typeLabel":"string | string[]"},"variables":{"type":"object","description":"Template variables for personalization. Maximum 100 properties allowed.\nVariables are referenced in templates using double curly braces: `{{variable_name}}`\n\nNote: When using templates with variables (e.g., `{{variable_name}}`):\n- Default values can be defined in the template\n- Values provided through this API field will override any template defaults\n- Default values will be used when:\n - The variable is not provided at all\n - The variable is explicitly set to null\n - When using object format and value is null or undefined\n\nEach variable can be:\n- A string\n- A number\n- An object with:\n - `value`: string, number, or null\n - `default`: string or number (used when value is null)\n","maxProperties":100,"example":{"date":"27 November","plan":{"value":"Pro Plan","default":"Free Plan"},"company":{"value":null,"default":"our company"},"title":{"value":null,"default":"valued customer"}},"uniqueKey":"variables","typeLabel":"object"},"attachments":{"type":"array","description":"File attachments. You can attach files using either base64 encoded content or a URL path.\n\nLimits:\n- Maximum 10 attachments allowed\n- Total size must not exceed 40MB for all attachments combined\n- Each attachment must have:\n - `filename` (required)\n - Either `path` OR `content` (one must be provided)\n - `content_type` (optional, but highly recommended)\n - If not provided, falls back to `application/octet-stream`\n\n> **Tip**: You can upload files through the \"Assets\" in the template page. \n> These files will be served through our CDN, ensuring they are cached and optimized for delivery.\n\nExample using base64 content:\n```json\n{\n \"attachments\": [{\n \"filename\": \"document.pdf\",\n \"content\": \"base64EncodedString==\",\n \"content_type\": \"application/pdf\"\n }]\n}\n```\n\nExample using URL path:\n```json\n{\n \"attachments\": [{\n \"filename\": \"document.pdf\",\n \"path\": \"https://example.com/files/document.pdf\",\n \"content_type\": \"application/pdf\"\n }]\n}\n```\n\nExample with multiple attachments:\n```json\n{\n \"attachments\": [\n {\n \"filename\": \"document.pdf\",\n \"content\": \"base64EncodedString==\",\n \"content_type\": \"application/pdf\"\n },\n {\n \"filename\": \"image.jpg\",\n \"path\": \"https://example.com/files/image.jpg\",\n \"content_type\": \"image/jpeg\"\n }\n ]\n}\n```\n\nCommon errors:\n- `\"Too many attachments: 11. Max is 10\"`\n- `\"Total attachments size exceeds maximum of 40MB\"`\n- `\"attachments[0].filename is required\"`\n- `\"attachments[0] must have either path or content\"`\n- `\"attachments[0].path must be a valid URL\"`\n- `\"attachments[0].content must be a valid base64 encoded string\"`\n","maxItems":10,"items":{"type":"object","required":["filename"],"properties":{"filename":{"type":"string","description":"Name of the file (required)","isRequired":true,"uniqueKey":"attachments.items.[INDEX].filename","typeLabel":"string"},"path":{"type":"string","description":"URL to the file content. Must be a valid URL. Required if content is not provided.","format":"uri","uniqueKey":"attachments.items.[INDEX].path","typeLabel":"string\u003curi>"},"content":{"type":"string","description":"Base64 encoded file content. Must be a valid base64 string. Required if path is not provided.","format":"base64","uniqueKey":"attachments.items.[INDEX].content","typeLabel":"file"},"content_type":{"type":"string","description":"MIME type of the file. Highly recommended - if not provided, falls back to application/octet-stream","uniqueKey":"attachments.items.[INDEX].content_type","typeLabel":"string"}},"uniqueKey":"attachments.items.[INDEX]","typeLabel":"object"},"uniqueKey":"attachments","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"from":"Your Name \u003csender@yourdomain.com>","to":"recipient@example.com","subject":"Welcome to Our Service!","html":"\u003cp>Hello {{name}}!\u003c/p>","template_id":"welcome-template","text":"Hello {{name}}!","cc":"cc@example.com","bcc":"bcc@example.com","reply_to":"reply@yourdomain.com","variables":{"date":"27 November","plan":{"value":"Pro Plan","default":"Free Plan"},"company":{"value":null,"default":"our company"},"title":{"value":null,"default":"valued customer"}},"attachments":[{"filename":"\u003cstring>","path":"\u003cstring>","content":"aSDinaTvuI8gbWludGxpZnk=","content_type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"6f695f0c-fe58-4e4f-a500-de7d4ae2a02d":{"description":"Email successfully queued for sending","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the sent email","example":"0195c9e3-5067-741d-be87-a4f75ef93372","uniqueKey":"id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"0195c9e3-5067-741d-be87-a4f75ef93372"}}},"exampleType":"generated"}},"exampleType":"generated"},"c3a4cfa1-c82b-4f1d-9fcb-718f65b523cb":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error description","uniqueKey":"message","typeLabel":"string"}},"description":"Error response with message.\n\n### Common Errors\n\n#### 400 Bad Request\nValidation errors return only the error message:\n```json\n{\n \"message\": \"from field is required\"\n}\n```\n\nCommon validation messages:\n- `\"from field is required\"`\n- `\"to field is required\"`\n- `\"subject field is required\"`\n- `\"html content size (42MB) exceeds maximum of 40MB\"`\n- `\"Too many recipients: 51. Maximum allowed is 50\"`\n- `\"Invalid email format in from field\"`\n- `\"template_id cannot be used together with html\"`\n\n#### 403 Forbidden\nAuthentication errors include both message and code:\n```json\n{\n \"message\": \"Invalid API key\",\n \"code\": \"invalid_api_key\"\n}\n```\n```json\n{\n \"message\": \"Invalid authorization header\",\n \"code\": \"invalid_authorization_header\"\n}\n```\n\n#### 404 Not Found\n```json\n{\n \"message\": \"Template 'welcome-email' not found\"\n}\n```\n","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"0174851b-36c9-4d1d-821c-c816e1366699":{"description":"Forbidden (API key is missing or invalid)","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error description","uniqueKey":"message","typeLabel":"string"}},"description":"Error response with message.\n\n### Common Errors\n\n#### 400 Bad Request\nValidation errors return only the error message:\n```json\n{\n \"message\": \"from field is required\"\n}\n```\n\nCommon validation messages:\n- `\"from field is required\"`\n- `\"to field is required\"`\n- `\"subject field is required\"`\n- `\"html content size (42MB) exceeds maximum of 40MB\"`\n- `\"Too many recipients: 51. Maximum allowed is 50\"`\n- `\"Invalid email format in from field\"`\n- `\"template_id cannot be used together with html\"`\n\n#### 403 Forbidden\nAuthentication errors include both message and code:\n```json\n{\n \"message\": \"Invalid API key\",\n \"code\": \"invalid_api_key\"\n}\n```\n```json\n{\n \"message\": \"Invalid authorization header\",\n \"code\": \"invalid_authorization_header\"\n}\n```\n\n#### 404 Not Found\n```json\n{\n \"message\": \"Template 'welcome-email' not found\"\n}\n```\n","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"ec4decc4-9e54-43b0-8a09-5d0efefcc314":{"description":"Template not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error description","uniqueKey":"message","typeLabel":"string"}},"description":"Error response with message.\n\n### Common Errors\n\n#### 400 Bad Request\nValidation errors return only the error message:\n```json\n{\n \"message\": \"from field is required\"\n}\n```\n\nCommon validation messages:\n- `\"from field is required\"`\n- `\"to field is required\"`\n- `\"subject field is required\"`\n- `\"html content size (42MB) exceeds maximum of 40MB\"`\n- `\"Too many recipients: 51. Maximum allowed is 50\"`\n- `\"Invalid email format in from field\"`\n- `\"template_id cannot be used together with html\"`\n\n#### 403 Forbidden\nAuthentication errors include both message and code:\n```json\n{\n \"message\": \"Invalid API key\",\n \"code\": \"invalid_api_key\"\n}\n```\n```json\n{\n \"message\": \"Invalid authorization header\",\n \"code\": \"invalid_authorization_header\"\n}\n```\n\n#### 404 Not Found\n```json\n{\n \"message\": \"Template 'welcome-email' not found\"\n}\n```\n","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"9acad2cd-422e-4da5-ace4-7df668ae50e7":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key with format \"Bearer {your-api-key}\"","scopes":[]}}},"servers":{"1f27b192-a1af-46ae-b65f-2e32c68f5321":{"url":"https://api.maildiver.com/v1","description":"Production server","variables":{"domain":{"default":"yourdomain.com","description":"Your domain (without the api. prefix)"}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API key with format \"Bearer {your-api-key}\"","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key with format \"Bearer {your-api-key}\"","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.yml"},"subdomain":"selfmailkit","siteName":"MailDiver","title":"Send email - MailDiver","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-10-18T10:52:41.206Z","originalFileLocation":"api-reference/email/send-email.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Endpoint: v1/emails Send a transactional email with optional template, attachments, and variables\">\u003cmeta data-mint-head name=\"application-name\" content=\"MailDiver\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Send email - MailDiver\">\u003cmeta data-mint-head property=\"og:description\" content=\"Endpoint: v1/emails Send a transactional email with optional template, attachments, and variables\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MailDiver\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.maildiver.com/docs/api-reference/email/send-email\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://selfmailkit.mintlify.site/docs/_mintlify/api/og/v2?division=Email\u0026amp;title=Send+email\u0026amp;description=**Endpoint%3A**+%60v1%2Femails%60%0A%0ASend+a+transactional+email+with+optional+template%2C+attachments%2C+and+variables%0A\u0026amp;theme=4269b4114a8fa233fba200f2\u0026amp;signature=70571bf3819f2d652e68ce6724c0028f7f14299c6c180a15744d28322a5203c7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Send email - MailDiver\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Endpoint: v1/emails Send a transactional email with optional template, attachments, and variables\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://selfmailkit.mintlify.site/docs/_mintlify/api/og/v2?division=Email\u0026amp;title=Send+email\u0026amp;description=**Endpoint%3A**+%60v1%2Femails%60%0A%0ASend+a+transactional+email+with+optional+template%2C+attachments%2C+and+variables%0A\u0026amp;theme=4269b4114a8fa233fba200f2\u0026amp;signature=70571bf3819f2d652e68ce6724c0028f7f14299c6c180a15744d28322a5203c7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/selfmailkit/pJp9PBcsog2j48yY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MailDiver\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.maildiver.com/docs/api-reference/email/send-email\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/email/send-email.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.maildiver.com/#organization\",\"name\":\"MailDiver\",\"url\":\"https://docs.maildiver.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/selfmailkit/flS_Fi6hXDlFtHex/logo/light.svg?fit=max\u0026auto=format\u0026n=flS_Fi6hXDlFtHex\u0026q=85\u0026s=0023f9f8bf0e7cb7c2ba1ce8f3da8fe2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.maildiver.com/docs#website\",\"name\":\"MailDiver\",\"url\":\"https://docs.maildiver.com/docs\",\"publisher\":{\"@id\":\"https://docs.maildiver.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.maildiver.com/docs/api-reference/email/send-email#webpage\",\"url\":\"https://docs.maildiver.com/docs/api-reference/email/send-email\",\"name\":\"Send email\",\"description\":\"Endpoint: v1/emails Send a transactional email with optional template, attachments, and variables\",\"dateModified\":\"2025-10-18T10:52:41.206Z\",\"isPartOf\":{\"@id\":\"https://docs.maildiver.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://docs.maildiver.com/docs/api-reference/email/send-email#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.maildiver.com/docs/api-reference/email/send-email#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.maildiver.com/docs/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email\",\"item\":\"https://docs.maildiver.com/docs/api-reference/email/list-emails\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Send email\",\"item\":\"https://docs.maildiver.com/docs/api-reference/email/send-email\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.maildiver.com/docs/api-reference/email/send-email#apireference\",\"headline\":\"Send email\",\"name\":\"Send email\",\"description\":\"Endpoint: v1/emails Send a transactional email with optional template, attachments, and variables\",\"url\":\"https://docs.maildiver.com/docs/api-reference/email/send-email\",\"mainEntityOfPage\":{\"@id\":\"https://docs.maildiver.com/docs/api-reference/email/send-email#webpage\"},\"dateModified\":\"2025-10-18T10:52:41.206Z\",\"publisher\":{\"@id\":\"https://docs.maildiver.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.maildiver.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MailDiver\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"MailDiver","nav":{"global":{"anchors":[{"anchor":"Api Reference","icon":"slack","href":"https://docs.maildiver.com/api-reference/introduction"},{"anchor":"Help","icon":"question","href":"https://maildiver.com/help"}]},"groups":[{"group":"Managed (Cloud)","pages":[{"title":"Introduction to Managed Service","href":"/managed/introduction"},{"title":"Onboarding","href":"/managed/onboarding"},{"group":"SMTP","pages":[{"title":"Overview","href":"/managed/smtp/overview"},{"title":"Nodemailer","href":"/managed/smtp/nodemailer"}]}]},{"group":"Knowledge","pages":[{"title":"How to Add DNS Records","href":"/knowledge/guides/add-dns-records"},{"title":"How to Send Broadcast Emails","href":"/knowledge/guides/broadcast-emails"},{"title":"How Automation Workflows Work","href":"/knowledge/guides/automation-workflows"},{"title":"Best Practices","href":"/knowledge/guides/best-practices"}]},{"group":"Self-Hosted","pages":[{"title":"Welcome to MailDiver","href":"/self-hosted/introduction"},{"group":"How to Deploy","pages":[{"title":null,"href":"/self-hosted/how-to-deploy/overview"},{"title":"Step 1: Create a root AWS account","href":"/self-hosted/how-to-deploy/step1"},{"title":"Step 2: Protect your root account","href":"/self-hosted/how-to-deploy/step2"},{"title":"Step 3: Manage your account","href":"/self-hosted/how-to-deploy/step3"},{"title":"Deploy Mail","href":"/self-hosted/how-to-deploy/deploy"}]}]},{"group":"API Reference","pages":[{"title":"API Reference Introduction","href":"/api-reference/introduction"},{"group":"Email","pages":[{"title":"List emails","description":"**Endpoint:** `v1/emails`\n\nList all emails with pagination support. Returns 50 emails per page.\n","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /emails","href":"/api-reference/email/list-emails"},{"title":"Send email","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /emails","href":"/api-reference/email/send-email"},{"title":"Get email","description":"**Endpoint:** `v1/emails/{id}`\n\nRetrieve the status and details of a specific email\n","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /emails/{id}","href":"/api-reference/email/get-email"}]},{"group":"Domain","pages":[{"title":"List domains","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /domains","href":"/api-reference/domain/list-domains"},{"title":"Create domain","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /domains","href":"/api-reference/domain/create-domain"},{"title":"Get domain","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /domains/{id}","href":"/api-reference/domain/get-domain"},{"title":"Delete domain","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml delete /domains/{id}","href":"/api-reference/domain/delete-domain"}]},{"group":"Audience","pages":[{"title":"List audiences","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /audiences","href":"/api-reference/audience/list-audiences"},{"title":"Create audience","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /audiences","href":"/api-reference/audience/create-audience"},{"title":"Get audience","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /audiences/{id}","href":"/api-reference/audience/get-audience"},{"title":"Delete audience","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml delete /audiences/{id}","href":"/api-reference/audience/delete-audience"}]},{"group":"Contact","pages":[{"title":"List contacts","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /audiences/{audienceId}/contacts","href":"/api-reference/contact/list-contacts"},{"title":"Create contact","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /audiences/{audienceId}/contacts","href":"/api-reference/contact/create-contact"},{"title":"Get contact","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /audiences/{audienceId}/contacts/{contactId}","href":"/api-reference/contact/get-contact"},{"title":"Delete contact","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml delete /audiences/{audienceId}/contacts/{contactId}","href":"/api-reference/contact/delete-contact"},{"title":"Update contact","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml patch /audiences/{audienceId}/contacts/{contactId}","href":"/api-reference/contact/update-contact"}]},{"group":"Automation Event","pages":[{"title":"Send event","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml post /events","href":"/api-reference/automation-event/send-event"}]},{"group":"Automation Workflow","pages":[{"title":"List workflows","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /workflows","href":"/api-reference/automation-workflow/list-workflows"},{"title":"Get workflow","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /workflows/{id}","href":"/api-reference/automation-workflow/get-workflow"},{"title":"Delete workflow","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml delete /workflows/{id}","href":"/api-reference/automation-workflow/delete-workflow"},{"title":"Update workflow","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml patch /workflows/{id}","href":"/api-reference/automation-workflow/update-workflow"}]},{"group":"Automation Execution","pages":[{"title":"List workflow executions","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /workflows/{id}/executions","href":"/api-reference/automation-execution/list-workflow-executions"},{"title":"List workflow emails","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /workflows/{id}/emails","href":"/api-reference/automation-execution/list-workflow-emails"},{"title":"Get execution","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /executions/{id}","href":"/api-reference/automation-execution/get-execution"},{"title":"List execution emails","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /executions/{id}/emails","href":"/api-reference/automation-execution/list-execution-emails"}]},{"group":"Automation Contact","pages":[{"title":"List automation contacts","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /automation/contacts","href":"/api-reference/automation-contact/list-automation-contacts"},{"title":"Get automation contact","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /automation/contacts/{email}","href":"/api-reference/automation-contact/get-automation-contact"},{"title":"Update automation contact properties","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml patch /automation/contacts/{email}","href":"/api-reference/automation-contact/update-automation-contact-properties"},{"title":"List contact executions","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /automation/contacts/{email}/executions","href":"/api-reference/automation-contact/list-contact-executions"},{"title":"List contact events","deprecated":null,"version":null,"openapi":"api-reference/openapi.yml get /automation/contacts/{email}/events","href":"/api-reference/automation-contact/list-contact-events"}]}]}]},"basePath":"","title":"Send email - MailDiver","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CNqlzjVB.js","utils-BqFiXZ79.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CnR4QBe6.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BY2ZM1OO.js","snippetPresets-x-8ACO8V.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ch-SJE05.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CqqG_0NE.js","shallow-BXrZ2b0C.js","getApiPlaygroundDisplay-n7J_wkjq.js","CodeSnippet-CQsp4vyQ.js","CodeSnippets-BfuHqvZx.js","Page-CTxrMSpo.js","getPastedJson-BjrGIK1i.js","icon-7iLZnVOC.js","MethodPill-TBS1m84e.js","DuplicateIcon-BNMrV4Vs.js","createIcon-C5kCqeU2.js","DynamicMarkdown-Bq09mRwR.js","SectionHeading-G4Bflf5Q.js","axios-vUo_bRtp.js","Markdown-BTUds0aX.js","clsx-6wHzaN2_.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BPypQKlo.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-o6bee4ro.js"]}