---
title: "Post Ai Builder Link Draft"
method: POST
path: "/v1/flow_automation/ai_builder/link_draft"
tags: ["flow_automation", "flow_automation_ai_builder"]
---

# Post Ai Builder Link Draft

`POST /v1/flow_automation/ai_builder/link_draft`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/flow_automation/ai_builder/link_draft`
- Auth: HTTP bearer

Reassign a draft's active chat session to a newly saved flow so the
AI conversation carries over. The frontend calls this right after it
saves a /create flow, passing the draft_key it used and the new
flow_automation_id. Idempotent no-op (linked=False) when the draft had
no session.

## Request body

- LinkDraftPayload: Body for `POST /ai_builder/link_draft`. Sent right after a draft flow is saved: reassigns the draft's active chat session to the newly created flow so the conversation carries over.
  - `draft_key` string, required
  - `flow_automation_id` integer, required

## Response `200`

Successful Response

- LinkDraftResponse: Returned by `POST /ai_builder/link_draft`. `session_id` is null when the draft had no session to link (nothing to do).
  - `linked` boolean, required
  - `flow_automation_id` integer, required
  - `session_id` integer, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
