---
title: "Regenerate Drafts"
method: POST
path: "/v2/emails/drafts/regenerate"
tags: ["emails"]
---

# Regenerate Drafts

`POST /v2/emails/drafts/regenerate`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/emails/drafts/regenerate`
- Auth: HTTP bearer

Regenerate pending outreach drafts from their current templates.

Drafts are rendered when an outreach stage or statement schedule runs, so a
template fix does not reach drafts already waiting for approval. This queues a
background job that re-renders the selected unsent drafts through the same
path that created them and replaces the old drafts. Nothing is sent. By
default, drafts a user has already edited are left as they are.

With no filter every pending outreach draft is regenerated; `workflow_id`
limits it to one workflow and `email_ids` to specific drafts. Returns the
number of drafts queued; the regeneration completes asynchronously.

## Request body

- RegenerateDraftsRequest: Which pending outreach drafts to re-render. With no filter, every pending draft.
  - `workflow_id` string, nullable: Only drafts produced by this outreach workflow's stages or statement schedule.
  - `email_ids` string[], nullable: Only these draft emails. Drafts not produced by outreach are ignored.
  - `skip_edited` boolean: Leave drafts whose body a user has already edited untouched. Set to false to replace those drafts too, discarding the edits.

## Response `202`

Successful Response

- RegenerateDraftsResponse
  - `draft_count` integer, required: Pending drafts queued for regeneration.
  - `unsupported_count` integer, required: Requested emails that cannot be regenerated: not a pending draft, or not produced by an outreach stage or statement schedule. Always 0 without email_ids.
  - `skip_edited` boolean, required

## Other responses

- `404`: Not Found
- `422`: Validation Error

---

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