---
title: "GenerateAdhocEmail"
method: POST
path: "/api/Email/GenerateAdhocEmail"
tags: ["Email"]
---

# GenerateAdhocEmail

`POST /api/Email/GenerateAdhocEmail`

## Request

- Base URL: `https://eu-ext.linnworks.net`
- URL: `https://eu-ext.linnworks.net/api/Email/GenerateAdhocEmail`
- Auth: API key in header `Authorization`

Generate a custom email
<b>Permissions Required: </b> GlobalPermissions.Email.SendEmails.SendAdhocEmailsNode
<b>Rate limit: </b><span style="background-color:#0272d9;color:white;padding:4px 8px;text-align:center;border-radius:5px; font-size: small;"><b>150</b></span> / minute

## Request body

- EmailGenerateAdhocEmailRequest
  - `request` GenerateAdhocEmailRequest: Custom email generation request body
    - `ids` string[]: List of ids to send template for
    - `templateId` integer: Template id to send
    - `tags` EmailStubCustomTag[]: Tags to append to email
      - `pkEmailStubTagId` integer: Row id
      - `fkEmailStubId` integer: Relation to email_stub
      - `TagName` string: Name of the tag
      - `TagValue` string: Value which will be inserted into the template
    - `attachments` string[]: List of attachments to send with the email

## Response `200`

OK

- GenerateAdhocEmailResponse
  - `isComplete` boolean: Send custom emails completed
  - `FailedRecipients` string[]: List of failed recipients

---

[API](https://skmtc.dev/linnworks/apis/email-api.md) - [All operations](https://skmtc.dev/linnworks/apis/email-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linnworks/apis/email-api/revisions/e4c8f16841f3?raw)
