---
title: "Build a draft comment automation"
method: POST
path: "/automation/drafts"
tags: ["Automation"]
---

# Build a draft comment automation

`POST /automation/drafts`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/automation/drafts`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `/api/oauth/authorize`, token URL `/api/oauth/token`, scopes: `flows:write`, `posts:write`)

Builds the draft before the post is saved. `funnel` and `template` are ready at once; `prompt` answers `building` — poll GET /automation/drafts/{flowId}.

## Request body

- CreatePostAutomationDraftRequest: Exactly the fields of one door; any other field is rejected with 400 invalid_body.
  - `door` 'funnel' | 'template' | 'prompt', required
  - `account_id` string, required: The Instagram account the automation listens on.
  - `keyword` string: door `funnel` only (required there).
  - `link` string, uri: door `funnel` only.
  - `template_id` string: door `template` only (required there).
  - `inputs` object: door `template` only.
  - `prompt` string: door `prompt` only (required there).

## Response `201`

Draft created

- object
  - `data` object, required
    - `flow_id` string, required
    - `door` string, required: The door used. Known values: `funnel`, `template`, `prompt`. Treat any other value as unknown, never as an error.
    - `state` string, required: Build state. Known values: `ready`, `building`. Treat any other value as unknown, never as an error.

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `404`: Instagram account not connected (account_not_found)
- `409`: Reconnect the account first (account_disconnected)
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/sociahive/apis/sociahive-api.md) · [All operations](https://skmtc.dev/sociahive/apis/sociahive-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociahive/apis/sociahive-api/revisions/791b8548d288?raw)
