{
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more fields are invalid",
"meta": {
"issues": [
{
"field": "to.0.value",
"code": "invalid_format",
"message": "must be a valid email address"
}
]
}
},
"requestId": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
Email
Send an email
Sends an outbound email scoped to your company. Two usage patterns:
userId and channelId are required on every call.
From an existing draft — also provide discussionId and uuid returned by
POST /api/email/create-draft. The draft’s stored recipients, subject, and body are
used.
On-the-fly — omit uuid and provide userId, channelId, recipients, subject,
and body. A draft is created automatically before sending. Supplying discussionId
(without uuid) sends the message as a reply into that existing thread — the
thread’s subject is kept; omitting both discussionId and uuid starts a new thread.
Adding attachments
Attachments apply to the on-the-fly pattern (for an existing draft, attach files
when you call POST /api/email/create-draft). Upload each file with the three-step
direct upload flow first — you cannot post file bytes to this endpoint:
Get an upload URL — POST /api/files/upload-url with attachEntityType: "channel",
attachEntityId set to the same channelId you’re sending from, and the file’s
name, extension, size, and contentType. Returns { fileId, url, fields }.
Upload to S3 — multipart/form-dataPOST to url, all fields first then the
file bytes last as a file field. S3 returns 204.
Mark complete — POST /api/files/upload-complete with the fileId.
Then, on this request:
Regular attachment — add the fileId(s) to attachmentIds.
Inline image — embed an <img> in the HTML body whose src is the file’s
download URL (.../cdn/storage/AptlyFiles/<fileId>/original/...). Auto-detected and
registered; do not also list it in attachmentIds.
Stream ID from POST /api/email/create-draft (required if uuid is set).
When supplied without uuid, the on-the-fly draft is appended as a reply
into this existing thread (same company + channel) instead of starting a
new discussion; the thread's subject is kept.
Email body (plain text or HTML). To embed an uploaded image inline, add
an <img> whose src is the file's download URL from
POST /api/files/upload-complete
(.../cdn/storage/AptlyFiles/<fileId>/original/...). Inline images are
auto-detected, tagged with data-inline-image-id, and registered on the
draft — do not also list them in attachmentIds. Applies when the draft
is created on-the-fly (no discussionId/uuid).
File ids to include as regular attachments (applies when the draft is
created on-the-fly). Upload each file first (POST /api/files/upload-url
with attachEntityType channel and the same channelId → upload to S3 →
POST /api/files/upload-complete), then pass the resulting fileIds here.
Each must reference a finished upload.
Card to link the outbound to. Logs the email as an activity on the
card and tags the discussion. Works whether the draft was pre-created
or is created on-the-fly.
Response
Email sent successfully.
The response is of type object.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Aptly API","colors":{"primary":"#0066FF"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"aptly-10a57313","hasAudioNarration":false,"actualSubdomain":"aptly-10a57313","customDomains":["docs.getaptly.com"],"gitSource":{"type":"github","owner":"workturbo","repo":"core-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae4dfc987cb31e1fa2cb0ab","collectionId":"1788173d-2862-4418-873a-da2b64e83176","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4dfc987cb31e1fa2cb0ab"},"feedback":{"agentFeedback":true},"entitlements":{},"buildId":"6ae4dfc987cb31e1fa2cb0ab","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"API Reference","count":192},{"language":"default","tag":"Board","count":28},{"language":"default","tag":"Documentation","count":17},{"language":"default","tag":"Aptly Portal","count":14},{"language":"default","tag":"Contacts","count":10},{"language":"default","tag":"Cards","count":9},{"language":"default","tag":"Knowledge","count":8},{"language":"default","tag":"Getting Started","count":7},{"language":"default","tag":"Inboxes","count":7},{"language":"default","tag":"Context \u0026 Locations","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/email/send-an-email","slug":"/api-reference/email/send-an-email","pageMetadata":{"title":"Send an email","description":"Sends an outbound email scoped to your company. Two usage patterns:\n\n`userId` and `channelId` are required on every call.\n\n**From an existing draft** — also provide `discussionId` and `uuid` returned by\n`POST /api/email/create-draft`. The draft's stored recipients, subject, and body are\nused.\n\n**On-the-fly** — omit `uuid` and provide `userId`, `channelId`, recipients, subject,\nand body. A draft is created automatically before sending. Supplying `discussionId`\n(without `uuid`) sends the message as a reply into that existing thread — the\nthread's subject is kept; omitting both `discussionId` and `uuid` starts a new thread.\n\n### Adding attachments\n\nAttachments apply to the **on-the-fly** pattern (for an existing draft, attach files\nwhen you call `POST /api/email/create-draft`). Upload each file with the three-step\ndirect upload flow first — you cannot post file bytes to this endpoint:\n\n1. **Get an upload URL** — `POST /api/files/upload-url` with `attachEntityType: \"channel\"`,\n `attachEntityId` set to the same `channelId` you're sending from, and the file's\n `name`, `extension`, `size`, and `contentType`. Returns `{ fileId, url, fields }`.\n2. **Upload to S3** — `multipart/form-data` `POST` to `url`, all `fields` first then the\n file bytes last as a `file` field. S3 returns `204`.\n3. **Mark complete** — `POST /api/files/upload-complete` with the `fileId`.\n\nThen, on this request:\n- **Regular attachment** — add the `fileId`(s) to `attachmentIds`.\n- **Inline image** — embed an `\u003cimg>` in the HTML `body` whose `src` is the file's\n download URL (`.../cdn/storage/AptlyFiles/\u003cfileId>/original/...`). Auto-detected and\n registered; do **not** also list it in `attachmentIds`.\n\nEach `fileId` must reference a finished upload.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/email/send","href":"/api-reference/email/send-an-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 h3: \"h3\",\n li: \"li\",\n ol: \"ol\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Sends an outbound email scoped to your company. Two usage patterns:\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"userId\"\n }), \" and \", _jsx(_components.code, {\n children: \"channelId\"\n }), \" are required on every call.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"From an existing draft\"\n }), \" — also provide \", _jsx(_components.code, {\n children: \"discussionId\"\n }), \" and \", _jsx(_components.code, {\n children: \"uuid\"\n }), \" returned by\\n\", _jsx(_components.code, {\n children: \"POST /api/email/create-draft\"\n }), \". The draft’s stored recipients, subject, and body are\\nused.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"On-the-fly\"\n }), \" — omit \", _jsx(_components.code, {\n children: \"uuid\"\n }), \" and provide \", _jsx(_components.code, {\n children: \"userId\"\n }), \", \", _jsx(_components.code, {\n children: \"channelId\"\n }), \", recipients, subject,\\nand body. A draft is created automatically before sending. Supplying \", _jsx(_components.code, {\n children: \"discussionId\"\n }), \"\\n(without \", _jsx(_components.code, {\n children: \"uuid\"\n }), \") sends the message as a reply into that existing thread — the\\nthread’s subject is kept; omitting both \", _jsx(_components.code, {\n children: \"discussionId\"\n }), \" and \", _jsx(_components.code, {\n children: \"uuid\"\n }), \" starts a new thread.\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Adding attachments\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Attachments apply to the \", _jsx(_components.strong, {\n children: \"on-the-fly\"\n }), \" pattern (for an existing draft, attach files\\nwhen you call \", _jsx(_components.code, {\n children: \"POST /api/email/create-draft\"\n }), \"). Upload each file with the three-step\\ndirect upload flow first — you cannot post file bytes to this endpoint:\"]\n }), \"\\n\", _jsxs(_components.ol, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Get an upload URL\"\n }), \" — \", _jsx(_components.code, {\n children: \"POST /api/files/upload-url\"\n }), \" with \", _jsx(_components.code, {\n children: \"attachEntityType: \\\"channel\\\"\"\n }), \",\\n\", _jsx(_components.code, {\n children: \"attachEntityId\"\n }), \" set to the same \", _jsx(_components.code, {\n children: \"channelId\"\n }), \" you’re sending from, and the file’s\\n\", _jsx(_components.code, {\n children: \"name\"\n }), \", \", _jsx(_components.code, {\n children: \"extension\"\n }), \", \", _jsx(_components.code, {\n children: \"size\"\n }), \", and \", _jsx(_components.code, {\n children: \"contentType\"\n }), \". Returns \", _jsx(_components.code, {\n children: \"{ fileId, url, fields }\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Upload to S3\"\n }), \" — \", _jsx(_components.code, {\n children: \"multipart/form-data\"\n }), \" \", _jsx(_components.code, {\n children: \"POST\"\n }), \" to \", _jsx(_components.code, {\n children: \"url\"\n }), \", all \", _jsx(_components.code, {\n children: \"fields\"\n }), \" first then the\\nfile bytes last as a \", _jsx(_components.code, {\n children: \"file\"\n }), \" field. S3 returns \", _jsx(_components.code, {\n children: \"204\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Mark complete\"\n }), \" — \", _jsx(_components.code, {\n children: \"POST /api/files/upload-complete\"\n }), \" with the \", _jsx(_components.code, {\n children: \"fileId\"\n }), \".\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: \"Then, on this request:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Regular attachment\"\n }), \" — add the \", _jsx(_components.code, {\n children: \"fileId\"\n }), \"(s) to \", _jsx(_components.code, {\n children: \"attachmentIds\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Inline image\"\n }), \" — embed an \", _jsx(_components.code, {\n children: \"\u003cimg>\"\n }), \" in the HTML \", _jsx(_components.code, {\n children: \"body\"\n }), \" whose \", _jsx(_components.code, {\n children: \"src\"\n }), \" is the file’s\\ndownload URL (\", _jsx(_components.code, {\n children: \".../cdn/storage/AptlyFiles/\u003cfileId>/original/...\"\n }), \"). Auto-detected and\\nregistered; do \", _jsx(_components.strong, {\n children: \"not\"\n }), \" also list it in \", _jsx(_components.code, {\n children: \"attachmentIds\"\n }), \".\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Each \", _jsx(_components.code, {\n children: \"fileId\"\n }), \" must reference a finished upload.\"]\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 an email","description":"Sends an outbound email scoped to your company. Two usage patterns:\n\n`userId` and `channelId` are required on every call.\n\n**From an existing draft** — also provide `discussionId` and `uuid` returned by\n`POST /api/email/create-draft`. The draft's stored recipients, subject, and body are\nused.\n\n**On-the-fly** — omit `uuid` and provide `userId`, `channelId`, recipients, subject,\nand body. A draft is created automatically before sending. Supplying `discussionId`\n(without `uuid`) sends the message as a reply into that existing thread — the\nthread's subject is kept; omitting both `discussionId` and `uuid` starts a new thread.\n\n### Adding attachments\n\nAttachments apply to the **on-the-fly** pattern (for an existing draft, attach files\nwhen you call `POST /api/email/create-draft`). Upload each file with the three-step\ndirect upload flow first — you cannot post file bytes to this endpoint:\n\n1. **Get an upload URL** — `POST /api/files/upload-url` with `attachEntityType: \"channel\"`,\n `attachEntityId` set to the same `channelId` you're sending from, and the file's\n `name`, `extension`, `size`, and `contentType`. Returns `{ fileId, url, fields }`.\n2. **Upload to S3** — `multipart/form-data` `POST` to `url`, all `fields` first then the\n file bytes last as a `file` field. S3 returns `204`.\n3. **Mark complete** — `POST /api/files/upload-complete` with the `fileId`.\n\nThen, on this request:\n- **Regular attachment** — add the `fileId`(s) to `attachmentIds`.\n- **Inline image** — embed an `\u003cimg>` in the HTML `body` whose `src` is the file's\n download URL (`.../cdn/storage/AptlyFiles/\u003cfileId>/original/...`). Auto-detected and\n registered; do **not** also list it in `attachmentIds`.\n\nEach `fileId` must reference a finished upload.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/email/send","href":"/api-reference/email/send-an-email","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Send an email","description":"Sends an outbound email scoped to your company. Two usage patterns:\n\n`userId` and `channelId` are required on every call.\n\n**From an existing draft** — also provide `discussionId` and `uuid` returned by\n`POST /api/email/create-draft`. The draft's stored recipients, subject, and body are\nused.\n\n**On-the-fly** — omit `uuid` and provide `userId`, `channelId`, recipients, subject,\nand body. A draft is created automatically before sending. Supplying `discussionId`\n(without `uuid`) sends the message as a reply into that existing thread — the\nthread's subject is kept; omitting both `discussionId` and `uuid` starts a new thread.\n\n### Adding attachments\n\nAttachments apply to the **on-the-fly** pattern (for an existing draft, attach files\nwhen you call `POST /api/email/create-draft`). Upload each file with the three-step\ndirect upload flow first — you cannot post file bytes to this endpoint:\n\n1. **Get an upload URL** — `POST /api/files/upload-url` with `attachEntityType: \"channel\"`,\n `attachEntityId` set to the same `channelId` you're sending from, and the file's\n `name`, `extension`, `size`, and `contentType`. Returns `{ fileId, url, fields }`.\n2. **Upload to S3** — `multipart/form-data` `POST` to `url`, all `fields` first then the\n file bytes last as a `file` field. S3 returns `204`.\n3. **Mark complete** — `POST /api/files/upload-complete` with the `fileId`.\n\nThen, on this request:\n- **Regular attachment** — add the `fileId`(s) to `attachmentIds`.\n- **Inline image** — embed an `\u003cimg>` in the HTML `body` whose `src` is the file's\n download URL (`.../cdn/storage/AptlyFiles/\u003cfileId>/original/...`). Auto-detected and\n registered; do **not** also list it in `attachmentIds`.\n\nEach `fileId` must reference a finished upload.\n","operationId":"sendEmail","tags":["Email"],"security":["662ac6e0-3021-4569-b903-440c61a55e75","180b8be0-2831-4054-a76f-19d4f42f4d29","6c7d66bc-56b3-4245-a3b5-5e396ffc10a4"],"requestBody":"72326860-3f12-43d2-b908-5279cf6f9aed","responses":{"200":"87e4a635-28f5-47ac-ae64-f54691116b0a","400":"75cadae9-e6f4-45bf-882b-c30a8ab92b8a","401":"69dadc1f-47da-45b2-a7f5-e8441aaad2a4"},"method":"post","type":"path","servers":["07b42306-8584-4b68-93b8-f52adbaae2fe"],"path":"/api/email/send","baseUrlOptions":["https://core-api.getaptly.com"],"title":"Send an email","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","channelId"],"properties":{"userId":{"type":"string","description":"Required when sending on-the-fly (no `discussionId`/`uuid`).","isRequired":true,"uniqueKey":"userId","typeLabel":"string"},"channelId":{"type":"string","description":"Required when sending on-the-fly.","isRequired":true,"uniqueKey":"channelId","typeLabel":"string"},"discussionId":{"type":"string","description":"Stream ID from `POST /api/email/create-draft` (required if `uuid` is set).\nWhen supplied without `uuid`, the on-the-fly draft is appended as a reply\ninto this existing thread (same company + channel) instead of starting a\nnew discussion; the thread's subject is kept.\n","uniqueKey":"discussionId","typeLabel":"string"},"uuid":{"type":"string","description":"Draft UUID from `POST /api/email/create-draft`. Required if `discussionId` is set.","uniqueKey":"uuid","typeLabel":"string"},"failOnCreateNewThread":{"type":"boolean","default":true,"description":"If `true` (default), the send fails when the email would create a new\ndiscussion thread rather than reply to an existing one.\n","uniqueKey":"failOnCreateNewThread","typeLabel":"boolean"},"companyId":{"type":"string","description":"Company ID. Required only when authenticating with a partner token; resolved automatically for API key and delegate token auth.","uniqueKey":"companyId","typeLabel":"string"},"to":{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"Email address.","isRequired":true,"uniqueKey":"to.items.[INDEX].value","typeLabel":"string"},"label":{"type":"string","description":"Optional display name for the recipient.","uniqueKey":"to.items.[INDEX].label","typeLabel":"string"}},"uniqueKey":"to.items.[INDEX]","typeLabel":"object"},"uniqueKey":"to","typeLabel":"object[]"},"cc":{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"Email address.","isRequired":true,"uniqueKey":"cc.items.[INDEX].value","typeLabel":"string"},"label":{"type":"string","description":"Optional display name for the recipient.","uniqueKey":"cc.items.[INDEX].label","typeLabel":"string"}},"uniqueKey":"cc.items.[INDEX]","typeLabel":"object"},"uniqueKey":"cc","typeLabel":"object[]"},"bcc":{"type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"Email address.","isRequired":true,"uniqueKey":"bcc.items.[INDEX].value","typeLabel":"string"},"label":{"type":"string","description":"Optional display name for the recipient.","uniqueKey":"bcc.items.[INDEX].label","typeLabel":"string"}},"uniqueKey":"bcc.items.[INDEX]","typeLabel":"object"},"uniqueKey":"bcc","typeLabel":"object[]"},"subject":{"type":"string","uniqueKey":"subject","typeLabel":"string"},"body":{"type":"string","description":"Email body (plain text or HTML). To embed an uploaded image inline, add\nan `\u003cimg>` whose `src` is the file's download URL from\n`POST /api/files/upload-complete`\n(`.../cdn/storage/AptlyFiles/\u003cfileId>/original/...`). Inline images are\nauto-detected, tagged with `data-inline-image-id`, and registered on the\ndraft — do not also list them in `attachmentIds`. Applies when the draft\nis created on-the-fly (no `discussionId`/`uuid`).\n","uniqueKey":"body","typeLabel":"string"},"attachmentIds":{"type":"array","items":{"type":"string","uniqueKey":"attachmentIds.items.[INDEX]","typeLabel":"string"},"description":"File ids to include as regular attachments (applies when the draft is\ncreated on-the-fly). Upload each file first (`POST /api/files/upload-url`\nwith attachEntityType `channel` and the same channelId → upload to S3 →\n`POST /api/files/upload-complete`), then pass the resulting `fileId`s here.\nEach must reference a finished upload.\n","uniqueKey":"attachmentIds","typeLabel":"string[]"},"aptletInstanceId":{"type":"string","description":"Card to link the outbound to. Logs the email as an activity on the\ncard and tags the discussion. Works whether the draft was pre-created\nor is created on-the-fly.\n","uniqueKey":"aptletInstanceId","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"from_draft":{"title":"from_draft","value":{"userId":"user_abc","channelId":"channel_abc","discussionId":"stream_abc","uuid":"draft_xyz"}},"on_the_fly":{"title":"on_the_fly","value":{"userId":"user_abc","channelId":"channel_abc","to":[{"value":"[email protected]"}],"subject":"Your lease renewal","body":"Please review the attached renewal terms.","aptletInstanceId":"card_abc"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"87e4a635-28f5-47ac-ae64-f54691116b0a":{"description":"Email sent successfully.","content":{"application/json":{"schema":{"type":"object","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{}}},"exampleType":"generated"}},"exampleType":"generated"},"75cadae9-e6f4-45bf-882b-c30a8ab92b8a":{"description":"The request body failed validation, for example a recipient that is not an email address, or a missing `userId` or `channelId`. See `meta.issues` for each field.","content":{"application/json":{"schema":{"type":"object","description":"Returned with HTTP 400 when the request body fails shape validation (wrong type,\nmissing required field, malformed email/phone number, value out of bounds).\n`meta.issues` lists every offending field.\n","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","example":"One or more fields are invalid","uniqueKey":"error.message","typeLabel":"string"},"meta":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Dotted path to the offending property (for example `to.0.value`); empty for a problem with the body as a whole.","example":"to.0.value","uniqueKey":"error.meta.issues.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Machine-readable issue code (for example `invalid_type`, `invalid_format`, `too_small`).","example":"invalid_format","uniqueKey":"error.meta.issues.items.[INDEX].code","typeLabel":"string"},"message":{"type":"string","example":"must be a valid email address","uniqueKey":"error.meta.issues.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.meta.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.meta.issues","typeLabel":"object[]"}},"uniqueKey":"error.meta","typeLabel":"object"}},"uniqueKey":"error","typeLabel":"object"},"requestId":{"type":"string","description":"Id of the request; also sent on every response as the `X-Request-Id` header.","uniqueKey":"requestId","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"VALIDATION_ERROR","message":"One or more fields are invalid","meta":{"issues":[{"field":"to.0.value","code":"invalid_format","message":"must be a valid email address"}]}},"requestId":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"69dadc1f-47da-45b2-a7f5-e8441aaad2a4":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>","message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"662ac6e0-3021-4569-b903-440c61a55e75":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-token","scopes":[],"schemeName":"ApiKeyHeader"}},"180b8be0-2831-4054-a76f-19d4f42f4d29":{"DelegateToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Delegate token issued by the platform. Format: `DelegateToken \u003ctoken>`","scopes":[],"schemeName":"DelegateToken"}},"6c7d66bc-56b3-4245-a3b5-5e396ffc10a4":{"PartnerBearer":{"type":"http","scheme":"bearer","description":"Partner token. Format: `Authorization: Bearer \u003ctoken>`","scopes":[],"schemeName":"PartnerBearer"}}},"servers":{"07b42306-8584-4b68-93b8-f52adbaae2fe":{"url":"https://core-api.getaptly.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-token","scopes":[],"schemeName":"ApiKeyHeader"},"schema":{"title":"x-token","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyHeader","name":"x-token"}],"title":"ApiKeyHeader"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"Delegate token issued by the platform. Format: `DelegateToken \u003ctoken>`","scopes":[],"schemeName":"DelegateToken"},"schema":{"title":"Authorization","type":"string","description":"Delegate token issued by the platform. Format: `DelegateToken \u003ctoken>`","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"DelegateToken","name":"Authorization"}],"title":"DelegateToken"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Partner token. Format: `Authorization: Bearer \u003ctoken>`","scopes":[],"schemeName":"PartnerBearer"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Partner token. Format: `Authorization: Bearer \u003ctoken>`","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"PartnerBearer","name":"Authorization"}],"title":"PartnerBearer"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"aptly-10a57313","siteName":"Aptly API","title":"Send an email - Aptly API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T18:20:14.505Z","originalFileLocation":"api-reference/email/send-an-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=\"Sends an outbound email scoped to your company. Two usage patterns: userId and channelId are required on every call. From an existing draft — also provide discussionId and uuid returned by POST /api/email/create-draft. The draft\u0026#x27;s stored recipients, subject, and body are used. On-the-fly — omit uuid and provide userId, channelId, recipients, subject, and body. A draft is created automatically before sending. Supplying discussionId (without uuid) sends the message as a reply into that existing thread — the thread\u0026#x27;s subject is kept; omitting both discussionId and uuid starts a new thread. ### Adding attachments Attachments apply to the on-the-fly pattern (for an existing draft, attach files when you call POST /api/email/create-draft). Upload each file with the three-step direct upload flow first — you cannot post file bytes to this endpoint: 1. Get an upload URL — POST /api/files/upload-url with attachEntityType: \u0026quot;channel\u0026quot;, attachEntityId set to the same channelId you\u0026#x27;re sending from, and the file\u0026#x27;s name, extension, size, and contentType. Returns { fileId, url, fields }. 2. Upload to S3 — multipart/form-data POST to url, all fields first then the file bytes last as a file field. S3 returns 204. 3. Mark complete — POST /api/files/upload-complete with the fileId. Then, on this request: - Regular attachment — add the fileId(s) to attachmentIds. - Inline image — embed an in the HTML body whose src is the file\u0026#x27;s download URL (.../cdn/storage/AptlyFiles//original/...). Auto-detected and registered; do not also list it in attachmentIds. Each fileId must reference a finished upload.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Aptly API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/aptly-10a57313/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/aptly-10a57313/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/aptly-10a57313/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/aptly-10a57313/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Send an email - Aptly API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Sends an outbound email scoped to your company. Two usage patterns: userId and channelId are required on every call. From an existing draft — also provide discussionId and uuid returned by POST /api/email/create-draft. The draft\u0026#x27;s stored recipients, subject, and body are used. On-the-fly — omit uuid and provide userId, channelId, recipients, subject, and body. A draft is created automatically before sending. Supplying discussionId (without uuid) sends the message as a reply into that existing thread — the thread\u0026#x27;s subject is kept; omitting both discussionId and uuid starts a new thread. ### Adding attachments Attachments apply to the on-the-fly pattern (for an existing draft, attach files when you call POST /api/email/create-draft). Upload each file with the three-step direct upload flow first — you cannot post file bytes to this endpoint: 1. Get an upload URL — POST /api/files/upload-url with attachEntityType: \u0026quot;channel\u0026quot;, attachEntityId set to the same channelId you\u0026#x27;re sending from, and the file\u0026#x27;s name, extension, size, and contentType. Returns { fileId, url, fields }. 2. Upload to S3 — multipart/form-data POST to url, all fields first then the file bytes last as a file field. S3 returns 204. 3. Mark complete — POST /api/files/upload-complete with the fileId. Then, on this request: - Regular attachment — add the fileId(s) to attachmentIds. - Inline image — embed an in the HTML body whose src is the file\u0026#x27;s download URL (.../cdn/storage/AptlyFiles//original/...). Auto-detected and registered; do not also list it in attachmentIds. Each fileId must reference a finished upload.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Aptly API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getaptly.com/api-reference/email/send-an-email\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://aptly-10a57313.mintlify.app/_mintlify/api/og/v2?division=Email\u0026amp;title=Send+an+email\u0026amp;description=Sends+an+outbound+email+scoped+to+your+company.+Two+usage+patterns%3A%0A%0A%60userId%60+and+%60channelId%60+are+required+on+every+call.%0A%0A**From+an+existing+draft**+%E2%80%94+also+pro\u0026amp;theme=2df7969a14dd47f616338bb6\u0026amp;signature=5668e49537e1a37eeac9c6dcdbb78b8ded5b4c78b8c8da815646b560ccac0542\">\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 an email - Aptly API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Sends an outbound email scoped to your company. Two usage patterns: userId and channelId are required on every call. From an existing draft — also provide discussionId and uuid returned by POST /api/email/create-draft. The draft\u0026#x27;s stored recipients, subject, and body are used. On-the-fly — omit uuid and provide userId, channelId, recipients, subject, and body. A draft is created automatically before sending. Supplying discussionId (without uuid) sends the message as a reply into that existing thread — the thread\u0026#x27;s subject is kept; omitting both discussionId and uuid starts a new thread. ### Adding attachments Attachments apply to the on-the-fly pattern (for an existing draft, attach files when you call POST /api/email/create-draft). Upload each file with the three-step direct upload flow first — you cannot post file bytes to this endpoint: 1. Get an upload URL — POST /api/files/upload-url with attachEntityType: \u0026quot;channel\u0026quot;, attachEntityId set to the same channelId you\u0026#x27;re sending from, and the file\u0026#x27;s name, extension, size, and contentType. Returns { fileId, url, fields }. 2. Upload to S3 — multipart/form-data POST to url, all fields first then the file bytes last as a file field. S3 returns 204. 3. Mark complete — POST /api/files/upload-complete with the fileId. Then, on this request: - Regular attachment — add the fileId(s) to attachmentIds. - Inline image — embed an in the HTML body whose src is the file\u0026#x27;s download URL (.../cdn/storage/AptlyFiles//original/...). Auto-detected and registered; do not also list it in attachmentIds. Each fileId must reference a finished upload.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://aptly-10a57313.mintlify.app/_mintlify/api/og/v2?division=Email\u0026amp;title=Send+an+email\u0026amp;description=Sends+an+outbound+email+scoped+to+your+company.+Two+usage+patterns%3A%0A%0A%60userId%60+and+%60channelId%60+are+required+on+every+call.%0A%0A**From+an+existing+draft**+%E2%80%94+also+pro\u0026amp;theme=2df7969a14dd47f616338bb6\u0026amp;signature=5668e49537e1a37eeac9c6dcdbb78b8ded5b4c78b8c8da815646b560ccac0542\">\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=\"https://mintlify.s3.us-west-1.amazonaws.com/aptly-10a57313/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Aptly API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0066FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getaptly.com/api-reference/email/send-an-email\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/email/send-an-email.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.getaptly.com/#organization\",\"name\":\"Aptly API\",\"url\":\"https://docs.getaptly.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getaptly.com#website\",\"name\":\"Aptly API\",\"url\":\"https://docs.getaptly.com\",\"publisher\":{\"@id\":\"https://docs.getaptly.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getaptly.com/api-reference/email/send-an-email#webpage\",\"url\":\"https://docs.getaptly.com/api-reference/email/send-an-email\",\"name\":\"Send an email\",\"description\":\"Sends an outbound email scoped to your company. Two usage patterns: userId and channelId are required on every call. From an existing draft — also provide discussionId and uuid returned by POST /api/email/create-draft. The draft's stored recipients, subject, and body are used. On-the-fly — omit uuid and provide userId, channelId, recipients, subject, and body. A draft is created automatically before sending. Supplying discussionId (without uuid) sends the message as a reply into that existing thread — the thread's subject is kept; omitting both discussionId and uuid starts a new thread. ### Adding attachments Attachments apply to the on-the-fly pattern (for an existing draft, attach files when you call POST /api/email/create-draft). Upload each file with the three-step direct upload flow first — you cannot post file bytes to this endpoint: 1. Get an upload URL — POST /api/files/upload-url with attachEntityType: \\\"channel\\\", attachEntityId set to the same channelId you're sending from, and the file's name, extension, size, and contentType. Returns { fileId, url, fields }. 2. Upload to S3 — multipart/form-data POST to url, all fields first then the file bytes last as a file field. S3 returns 204. 3. Mark complete — POST /api/files/upload-complete with the fileId. Then, on this request: - Regular attachment — add the fileId(s) to attachmentIds. - Inline image — embed an in the HTML body whose src is the file's download URL (.../cdn/storage/AptlyFiles//original/...). Auto-detected and registered; do not also list it in attachmentIds. Each fileId must reference a finished upload.\",\"dateModified\":\"2026-10-30T18:20:14.505Z\",\"isPartOf\":{\"@id\":\"https://docs.getaptly.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getaptly.com/api-reference/email/send-an-email#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getaptly.com/api-reference/email/send-an-email#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.getaptly.com/api-reference/users/list-users\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Email\",\"item\":\"https://docs.getaptly.com/api-reference/email/create-an-email-draft\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Send an email\",\"item\":\"https://docs.getaptly.com/api-reference/email/send-an-email\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.getaptly.com/api-reference/email/send-an-email#apireference\",\"headline\":\"Send an email\",\"name\":\"Send an email\",\"description\":\"Sends an outbound email scoped to your company. Two usage patterns: userId and channelId are required on every call. From an existing draft — also provide discussionId and uuid returned by POST /api/email/create-draft. The draft's stored recipients, subject, and body are used. On-the-fly — omit uuid and provide userId, channelId, recipients, subject, and body. A draft is created automatically before sending. Supplying discussionId (without uuid) sends the message as a reply into that existing thread — the thread's subject is kept; omitting both discussionId and uuid starts a new thread. ### Adding attachments Attachments apply to the on-the-fly pattern (for an existing draft, attach files when you call POST /api/email/create-draft). Upload each file with the three-step direct upload flow first — you cannot post file bytes to this endpoint: 1. Get an upload URL — POST /api/files/upload-url with attachEntityType: \\\"channel\\\", attachEntityId set to the same channelId you're sending from, and the file's name, extension, size, and contentType. Returns { fileId, url, fields }. 2. Upload to S3 — multipart/form-data POST to url, all fields first then the file bytes last as a file field. S3 returns 204. 3. Mark complete — POST /api/files/upload-complete with the fileId. Then, on this request: - Regular attachment — add the fileId(s) to attachmentIds. - Inline image — embed an in the HTML body whose src is the file's download URL (.../cdn/storage/AptlyFiles//original/...). Auto-detected and registered; do not also list it in attachmentIds. Each fileId must reference a finished upload.\",\"url\":\"https://docs.getaptly.com/api-reference/email/send-an-email\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getaptly.com/api-reference/email/send-an-email#webpage\"},\"dateModified\":\"2026-10-30T18:20:14.505Z\",\"publisher\":{\"@id\":\"https://docs.getaptly.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getaptly.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Aptly API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Aptly API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"group":"Users","pages":[{"title":"List users","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/users","href":"/api-reference/users/list-users"},{"title":"List a user's email inboxes","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/users/{userId}/inboxes","href":"/api-reference/users/list-a-users-email-inboxes"}]},{"group":"Inboxes","pages":[{"title":"List inboxes you can query","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes","href":"/api-reference/inboxes/list-inboxes-you-can-query"},{"title":"List threads and messages on an inbox","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/messages","href":"/api-reference/inboxes/list-threads-and-messages-on-an-inbox"},{"title":"Conversation analytics for an inbox","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/analytics","href":"/api-reference/inboxes/conversation-analytics-for-an-inbox"},{"title":"Activity history for an inbox","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/history","href":"/api-reference/inboxes/activity-history-for-an-inbox"},{"title":"Volume and response-time trends for an inbox","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/trends","href":"/api-reference/inboxes/volume-and-response-time-trends-for-an-inbox"},{"title":"Volume health for an inbox against its own baseline","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/health","href":"/api-reference/inboxes/volume-health-for-an-inbox-against-its-own-baseline"},{"title":"List unsent drafts on an inbox","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/inboxes/{channelId}/drafts","href":"/api-reference/inboxes/list-unsent-drafts-on-an-inbox"}]},{"group":"Schema","pages":[{"title":"Get board schema","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/schema/{boardId}","href":"/api-reference/schema/get-board-schema"}]},{"group":"Boards","pages":[{"title":"List boards","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/boards","href":"/api-reference/boards/list-boards"},{"title":"Create a board","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/boards","href":"/api-reference/boards/create-a-board"}]},{"group":"Cards","pages":[{"title":"List cards","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/list","href":"/api-reference/cards/list-cards"},{"title":"List cards (deprecated)","deprecated":true,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}","href":"/api-reference/cards/list-cards-deprecated"},{"title":"Create or update a card","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}","href":"/api-reference/cards/create-or-update-a-card"},{"title":"Get a card","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/{cardId}","href":"/api-reference/cards/get-a-card"},{"title":"Archive a card","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /api/board/{boardId}/{cardId}","href":"/api-reference/cards/archive-a-card"},{"title":"List comments on a card","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/{cardId}/comments","href":"/api-reference/cards/list-comments-on-a-card"},{"title":"List contacts linked to a card","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/{cardId}/contacts","href":"/api-reference/cards/list-contacts-linked-to-a-card"},{"title":"Add or update a comment","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/{cardId}/comment","href":"/api-reference/cards/add-or-update-a-comment"},{"title":"Upload a file to a card","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/{cardId}/file","href":"/api-reference/cards/upload-a-file-to-a-card"}]},{"group":"Board","pages":[{"title":"Archive a board","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /api/board/{boardId}","href":"/api-reference/board/archive-a-board"},{"title":"List merge fields for a board","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/merge-fields","href":"/api-reference/board/list-merge-fields-for-a-board"},{"title":"List users who can open a board","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/users","href":"/api-reference/board/list-users-who-can-open-a-board"},{"title":"Add a tab view","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/configuration/tabViews","href":"/api-reference/board/add-a-tab-view"},{"title":"Add a tab view (legacy)","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/tabView","href":"/api-reference/board/add-a-tab-view-legacy"},{"title":"Verify a delegate token","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/verify-user","href":"/api-reference/board/verify-a-delegate-token"},{"title":"Set or update the board's webhook","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/webhook","href":"/api-reference/board/set-or-update-the-boards-webhook"},{"title":"Remove the board's webhook","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /api/board/{boardId}/webhook","href":"/api-reference/board/remove-the-boards-webhook"},{"title":"Get full board configuration","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration","href":"/api-reference/board/get-full-board-configuration"},{"title":"List board automations","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/automations","href":"/api-reference/board/list-board-automations"},{"title":"Create an automation","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/configuration/automations","href":"/api-reference/board/create-an-automation"},{"title":"List create-card rules","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/card-rules","href":"/api-reference/board/list-create-card-rules"},{"title":"Get board options","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/options","href":"/api-reference/board/get-board-options"},{"title":"List board fields","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/fields","href":"/api-reference/board/list-board-fields"},{"title":"Add a field","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/configuration/fields","href":"/api-reference/board/add-a-field"},{"title":"Add a mirror field","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/configuration/mirror-fields","href":"/api-reference/board/add-a-mirror-field"},{"title":"Update a field","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/board/{boardId}/configuration/fields/{fieldUuid}","href":"/api-reference/board/update-a-field"},{"title":"Delete a field","deprecated":null,"version":null,"openapi":"/openapi.yaml delete /api/board/{boardId}/configuration/fields/{fieldUuid}","href":"/api-reference/board/delete-a-field"},{"title":"Reorder fields","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/board/{boardId}/configuration/field-order","href":"/api-reference/board/reorder-fields"},{"title":"List board field groups","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/groups","href":"/api-reference/board/list-board-field-groups"},{"title":"Create a field group","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/board/{boardId}/configuration/groups","href":"/api-reference/board/create-a-field-group"},{"title":"Update a field group","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/board/{boardId}/configuration/groups/{groupUuid}","href":"/api-reference/board/update-a-field-group"},{"title":"Get the create-card form order","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/start-card-order","href":"/api-reference/board/get-the-create-card-form-order"},{"title":"Set the create-card form order","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/board/{boardId}/configuration/start-card-order","href":"/api-reference/board/set-the-create-card-form-order"},{"title":"Get board access settings","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/shares","href":"/api-reference/board/get-board-access-settings"},{"title":"Get board identity fields","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/theme","href":"/api-reference/board/get-board-identity-fields"},{"title":"Update board identity fields","deprecated":null,"version":null,"openapi":"/openapi.yaml patch /api/board/{boardId}/configuration/theme","href":"/api-reference/board/update-board-identity-fields"},{"title":"List board filters","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/board/{boardId}/configuration/filters","href":"/api-reference/board/list-board-filters"}]},{"group":"Company","pages":[{"title":"Get company info","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/company/info","href":"/api-reference/company/get-company-info"}]},{"group":"Contacts","pages":[{"title":"Get conversations for contacts","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts/conversations","href":"/api-reference/contacts/get-conversations-for-contacts"},{"title":"Get contact conversations","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/contacts/{contactId}/conversations","href":"/api-reference/contacts/get-contact-conversations"},{"title":"List contacts","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/contacts","href":"/api-reference/contacts/list-contacts"},{"title":"Create or update a contact","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts","href":"/api-reference/contacts/create-or-update-a-contact"},{"title":"Look up contacts by email","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts/by-email","href":"/api-reference/contacts/look-up-contacts-by-email"},{"title":"Initiate contact email verification","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts/verify-email","href":"/api-reference/contacts/initiate-contact-email-verification"},{"title":"Confirm contact email verification","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts/verify-email/{requestId}/confirm","href":"/api-reference/contacts/confirm-contact-email-verification"},{"title":"Get a contact","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/contacts/{contactId}","href":"/api-reference/contacts/get-a-contact"},{"title":"Update a contact","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/contacts/{contactId}","href":"/api-reference/contacts/update-a-contact"},{"title":"Get a contact's sentiment history","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/contacts/{contactId}/sentiment","href":"/api-reference/contacts/get-a-contacts-sentiment-history"}]},{"group":"Knowledge","pages":[{"title":"Create a knowledge document","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/knowledge/create","href":"/api-reference/knowledge/create-a-knowledge-document"},{"title":"List knowledge documents","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/list","href":"/api-reference/knowledge/list-knowledge-documents"},{"title":"Get the knowledge document tree","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/tree","href":"/api-reference/knowledge/get-the-knowledge-document-tree"},{"title":"List a knowledge document's direct children","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/{id}/children","href":"/api-reference/knowledge/list-a-knowledge-documents-direct-children"},{"title":"List saved knowledge document versions","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/{id}/history","href":"/api-reference/knowledge/list-saved-knowledge-document-versions"},{"title":"Read a saved knowledge document version","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/{id}/history/{versionId}","href":"/api-reference/knowledge/read-a-saved-knowledge-document-version"},{"title":"Get a knowledge document","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/knowledge/{id}","href":"/api-reference/knowledge/get-a-knowledge-document"},{"title":"Update a knowledge document","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/knowledge/{id}","href":"/api-reference/knowledge/update-a-knowledge-document"}]},{"group":"Email","pages":[{"title":"Create an email draft","description":"Creates a new outbound email discussion (stream) with a single draft entry, scoped to\nyour company. Returns the `streamId` and `draftUuid` needed to send via\n`POST /api/email/send`.\n\nRecipient fields (`to`, `cc`, `bcc`) accept an array of `{ value, label? }` objects\nwhere `value` is the email address.\n\n### Adding attachments\n\nAttachments must be uploaded to storage **before** you reference them here — you\ncannot post file bytes to this endpoint. Upload each file with the three-step direct\nupload flow, then attach it:\n\n1. **Get an upload URL** — `POST /api/files/upload-url` with `attachEntityType: \"channel\"`,\n `attachEntityId` set to the same `channelId` you're emailing from, and the file's\n `name`, `extension`, `size`, and `contentType`. It returns `{ fileId, url, fields }`.\n2. **Upload to S3** — send a `multipart/form-data` `POST` to `url`, appending every\n entry from `fields` first and the file bytes last as a `file` field. S3 returns `204`.\n3. **Mark complete** — `POST /api/files/upload-complete` with the `fileId` from step 1.\n\nThen, on this request:\n- **Regular attachment** — add the `fileId`(s) to `attachmentIds`.\n- **Inline image** — embed an `\u003cimg>` in the HTML `body` whose `src` is the file's\n download URL (`.../cdn/storage/AptlyFiles/\u003cfileId>/original/...`, returned by step 3).\n It is auto-detected and registered; do **not** also list it in `attachmentIds`.\n\nRepeat steps 1–3 per file. Each `fileId` must reference a finished upload or the\nrequest is rejected.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/email/create-draft","href":"/api-reference/email/create-an-email-draft"},{"title":"Send an email","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/email/send","href":"/api-reference/email/send-an-email"}]},{"group":"App","pages":[{"title":"Verify a delegate token (keyless)","description":"Validates a short-lived delegate token without requiring an API key. The token must\ninclude an `appClientId` (i.e. it was issued for an embedded app via\n`POST /api/platform/user-token`). Returns the user's identity, company name, and\nthe app's title.\n","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/app/verify","href":"/api-reference/app/verify-a-delegate-token-keyless"},{"title":"Get credential info","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/app/me","href":"/api-reference/app/get-credential-info"}]},{"group":"Templates","pages":[{"title":"List templates","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/templates","href":"/api-reference/templates/list-templates"},{"title":"Create a template","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/templates","href":"/api-reference/templates/create-a-template"},{"title":"Get a template","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/templates/{id}","href":"/api-reference/templates/get-a-template"},{"title":"Update a template","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/templates/{id}","href":"/api-reference/templates/update-a-template"}]},{"group":"Tasks","pages":[{"title":"Search tasks","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/tasks/search","href":"/api-reference/tasks/search-tasks"},{"title":"Create a task","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/tasks","href":"/api-reference/tasks/create-a-task"},{"title":"Update many tasks","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/tasks/bulk-update","href":"/api-reference/tasks/update-many-tasks"},{"title":"Get a task by ID","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/tasks/{taskId}","href":"/api-reference/tasks/get-a-task-by-id"},{"title":"Update a task","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/tasks/{taskId}","href":"/api-reference/tasks/update-a-task"}]},{"group":"RoutingGroups","pages":[{"title":"List routing groups","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/routing-groups","href":"/api-reference/routinggroups/list-routing-groups"},{"title":"Create a routing group","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/routing-groups/create","href":"/api-reference/routinggroups/create-a-routing-group"},{"title":"Update a routing group","deprecated":null,"version":null,"openapi":"/openapi.yaml put /api/routing-groups/{id}","href":"/api-reference/routinggroups/update-a-routing-group"},{"title":"Archive a routing group","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/routing-groups/{id}/archive","href":"/api-reference/routinggroups/archive-a-routing-group"}]},{"group":"Files","pages":[{"title":"Get a presigned URL for a direct file upload","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/files/upload-url","href":"/api-reference/files/get-a-presigned-url-for-a-direct-file-upload"},{"title":"Finalize a direct file upload","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/files/upload-complete","href":"/api-reference/files/finalize-a-direct-file-upload"}]},{"group":"WebForms","pages":[{"title":"Submit a web form","deprecated":null,"version":null,"openapi":"/openapi.yaml post /api/web-forms/{formId}","href":"/api-reference/webforms/submit-a-web-form"}]},{"group":"Tours","pages":[{"title":"List tour feedback","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/tours/feedback","href":"/api-reference/tours/list-tour-feedback"},{"title":"Get one showing's tour feedback","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/tours/{showingId}/feedback","href":"/api-reference/tours/get-one-showings-tour-feedback"}]},{"group":"Docs","pages":[{"title":"Fetch this OpenAPI spec","deprecated":null,"version":null,"openapi":"/openapi.yaml get /api/docs/openapi","href":"/api-reference/docs/fetch-this-openapi-spec"}]}]}]},{"tab":"Aptly Portal","icon":"door-closed","pages":[{"title":"Aptly Portal","href":"/portal/introduction"}]}]},"basePath":"","title":"Send an email - Aptly API","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js","Markdown-BOgQCTwD.js","clsx-BIWXJmsZ.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DKZWslLH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-UDqbR6xh.js"]}