---
title: "Preview a draft comment automation"
method: GET
path: "/automation/drafts/{flowId}"
tags: ["Automation"]
---

# Preview a draft comment automation

`GET /automation/drafts/{flowId}`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/automation/drafts/{flowId}`
- 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:read`, `posts:read`)

What the draft sends, its blanks and its `content_hash`. Poll every 2 s while `building`.

## Path parameters

- `flowId` string, required: MongoDB ObjectId (24-character hex string)

## Response `200`

Draft preview

- object
  - `data` PostAutomationDraftPreview, required
    - `flow_id` string, required
    - `state` string, required: Build state. Known values: `building`, `ready`, `failed`. Treat any other value as unknown, never as an error.
    - `snapshot` object, nullable, required: The web recipe projection.
    - `steps` string[], required: The recipe as numbered plain lines.
    - `blanks` PostAutomationBlank[], required
      - `nodeId` string, required
      - `nodeName` string, required
      - `token` string, required
      - `context` string, required
      - `link` boolean, required
    - `content_hash` string, required: Send back as `previewed_hash` to arm.
    - `error` object
      - `reason` string, required
      - `message` string, required

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `404`: Automation not found (flow_not_found)
- `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)
