---
title: "Create a Flow document"
method: POST
path: "/v1/documents"
tags: ["Documents"]
---

# Create a Flow document

`POST /v1/documents`

## Request

- Base URL: `https://contentmaschine.ai/api`
- URL: `https://contentmaschine.ai/api/v1/documents`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://contentmaschine.ai/api/oauth/authorize`, token URL `https://contentmaschine.ai/api/oauth/token`)

Costs NO credits: the `initial_message` it returns is a template, not a model call. A `storybrand_framework_id` you do not own is a 400.

## Request body

- object
  - `title` string: Optional.
  - `content` string: Optional initial content.
  - `document_type` string: Optional document type.
  - `project_id` integer: Optional project to file it under.
  - `storybrand_framework_id` integer: Optional StoryBrand framework (integer id) you own.

## Response `201`

The created document.

- object
  - `success` boolean
  - `data` object
    - `document` object
    - `session_uuid` string, uuid
    - `framework` object, nullable
    - `initial_message` string: Template text. Not a model call.
  - `timestamp` string, date-time

## Other responses

- `400`: Malformed body, or a framework you do not own.
- `401`: Missing or invalid API key.
- `default`: Any other error. Every failure this API emits uses the same envelope; branch on `error.type`, never on `error.message`, and quote `error.correlation_id` to support.

---

[API](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api.md) · [All operations](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/contentmaschine/apis/contentmaschine-ai-api/revisions/28c74f46051c?raw)
