> For the complete documentation index, see [llms.txt](https://docs.autocontentapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autocontentapi.com/quick-start/documents/create-document.md).

# Create a Briefing Document

Generate NotebookLM-style briefing documents by calling `/content/Create` with `outputType: "briefing_doc"`. The API supports three result formats:

* `pdf` — uploads a generated PDF and returns a URL
* `html` — returns structured HTML content
* `text` — returns plain text content

If you omit `format`, the API defaults to `pdf`.

Need a reusable file ID for a private PDF first? Follow [Upload Private Files](/quick-start/tools/upload-files.md).

## Step 1: Create the Document Request

Send a POST request to `/content/Create` with your source material and set `outputType` to `briefing_doc`.

```bash
curl -X POST "https://api.autocontentapi.com/content/Create" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "outputType": "briefing_doc",
    "format": "pdf",
    "resources": [
      {
        "type": "website",
        "content": "https://example.com/enterprise-ai-market-update"
      }
    ],
    "text": "Create an executive briefing for B2B SaaS leaders. Include market shifts, key risks, and recommended actions.",
    "language": "English"
  }'
```

### Example Response

```json
{
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0
}
```

Save the `request_id`. You will use it both for `/content/Status/{id}` and for the `/documents` endpoints.

## Step 2: Poll for Status

Use the returned `request_id` to track generation progress:

```bash
curl -X GET "https://api.autocontentapi.com/content/Status/550e8400-e29b-41d4-a716-446655440000" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### While Processing

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 80,
  "updated_on": "2026-03-11T19:10:00Z",
  "error_code": 0,
  "requested_on": "2026-03-11T19:08:00Z"
}
```

### Status Values

* `0` = Pending or queued
* `5` = Early processing stages
* `80` = Document generation in progress
* `100` = Completed

## Step 3: Read the Result from `/content/Status/{id}`

The final payload depends on the selected `format`.

### Completed PDF Result

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "audio_title": "Briefing Document: Enterprise AI Market Update",
  "status": 100,
  "audio_url": "https://autocontentapi.blob.core.windows.net/audios/briefing-doc-550e8400.pdf",
  "response_text": "",
  "requested_on": "2026-03-11T19:08:00Z",
  "updated_on": "2026-03-11T19:12:00Z",
  "request_type_id": 1,
  "error_code": 0,
  "error_on": null,
  "citations": [],
  "file_size": 0,
  "audio_duration": 0,
  "share_url": "https://autocontentapi.blob.core.windows.net/audios/briefing-doc-550e8400.pdf",
  "briefing_doc_url": "https://autocontentapi.blob.core.windows.net/audios/briefing-doc-550e8400.pdf",
  "document_type": "briefing_doc",
  "document_format": "pdf",
  "document_content": "",
  "document_url": "https://autocontentapi.blob.core.windows.net/audios/briefing-doc-550e8400.pdf",
  "title": "Briefing Document: Enterprise AI Market Update"
}
```

### Completed HTML or Text Result

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "audio_title": "Briefing Document: Enterprise AI Market Update",
  "status": 100,
  "audio_url": "",
  "response_text": "## Executive Summary\n\nThe enterprise AI market is consolidating around...",
  "requested_on": "2026-03-11T19:08:00Z",
  "updated_on": "2026-03-11T19:12:00Z",
  "request_type_id": 1,
  "error_code": 0,
  "error_on": null,
  "citations": [],
  "file_size": 0,
  "audio_duration": 0,
  "share_url": "",
  "briefing_doc_url": "",
  "document_type": "briefing_doc",
  "document_format": "text",
  "document_content": "## Executive Summary\n\nThe enterprise AI market is consolidating around...",
  "document_url": "",
  "title": "Briefing Document: Enterprise AI Market Update"
}
```

Use `document_format` to branch your client logic:

* `pdf`: read `briefing_doc_url` or `document_url`
* `html`: read `document_content`
* `text`: read `document_content` or `response_text`

## Step 4: Use the Documents API

The content status endpoint is enough for polling, but completed documents are also available through `/documents`.

### List Documents

```bash
curl -X GET "https://api.autocontentapi.com/documents/get?page=1&pageSize=10" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Example response:

```json
{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "briefing_doc",
      "format": "pdf",
      "title": "Briefing Document: Enterprise AI Market Update",
      "createdOn": "2026-03-11T19:12:00Z",
      "status": 100
    }
  ],
  "totalCount": 1,
  "page": 1,
  "pageSize": 10,
  "totalPages": 1
}
```

### Fetch One Document

```bash
curl -X GET "https://api.autocontentapi.com/documents/550e8400-e29b-41d4-a716-446655440000" \
  -H "accept: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Example PDF response:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "briefing_doc",
  "format": "pdf",
  "title": "Briefing Document: Enterprise AI Market Update",
  "status": 100,
  "createdOn": "2026-03-11T19:12:00Z",
  "content": "",
  "url": "https://autocontentapi.blob.core.windows.net/audios/briefing-doc-550e8400.pdf"
}
```

Example HTML response:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "type": "briefing_doc",
  "format": "html",
  "title": "Briefing Document: Enterprise AI Market Update",
  "status": 100,
  "createdOn": "2026-03-11T19:12:00Z",
  "content": "<h2>Executive Summary</h2><p>The enterprise AI market is consolidating...</p>",
  "url": ""
}
```

### Download the Stored Asset

```bash
curl -L "https://api.autocontentapi.com/documents/550e8400-e29b-41d4-a716-446655440000/download" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -o briefing-document.pdf
```

The download endpoint returns the correct file type automatically:

* PDF download for `format: "pdf"`
* `.html` download for `format: "html"`
* `.txt` download for `format: "text"`

## Supported Source Types

You can generate briefing documents from the same main source types used by other content endpoints:

| Type      | Description                                                                    | Example                                      |
| --------- | ------------------------------------------------------------------------------ | -------------------------------------------- |
| `website` | Public web page URL                                                            | `"https://example.com/report"`               |
| `youtube` | YouTube video URL                                                              | `"https://www.youtube.com/watch?v=VIDEO_ID"` |
| `text`    | Direct text instructions or source material                                    | `"Internal memo content..."`                 |
| `pdf`     | Base64-encoded PDF payload                                                     | `"BASE64_ENCODED_PDF"`                       |
| `file`    | File ID returned by [Upload Private Files](/quick-start/tools/upload-files.md) | `"YOUR_FILE_ID"`                             |

## Format Options

| Format | Behavior                                        | Best for                                        |
| ------ | ----------------------------------------------- | ----------------------------------------------- |
| `pdf`  | Generates a downloadable PDF and stores its URL | Client deliverables, handoffs, downloads        |
| `html` | Returns structured HTML in the API response     | CMS ingestion, rendering in apps                |
| `text` | Returns plain text content                      | Summaries, internal automation, search indexing |

## Tips for Better Results

1. Use `text` to specify audience, structure, and level of detail.
2. Pick `pdf` when humans will download the deliverable, and `html` or `text` when another system will consume it.
3. Poll `/content/Status/{id}` until `status` reaches `100` before calling `/documents/{id}`.
4. Use `/documents/get` to build document history views in your app.
5. If you need private PDFs, upload them first via [Upload Private Files](/quick-start/tools/upload-files.md) and reference the returned file ID with `type: "file"`.

## Error Handling

If generation fails, `/content/Status/{id}` returns the error metadata just like other content types:

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": 0,
  "error_code": 500,
  "error_message": "Unable to process this briefing document request right now. Please try again.",
  "error_on": "2026-03-11T19:09:30Z",
  "requested_on": "2026-03-11T19:08:00Z"
}
```

## What's Next?

* 📚 Browse the [Document Scenario Examples](/quick-start/documents/document-examples.md)
* 💻 Use the [Document Code Samples](/code-samples/documents/document-examples.md)
* 🔬 Combine research outputs with [Deep Research](/quick-start/deep-researches/start-deep-research.md)
* 📁 Upload a private PDF first with the Files API, then reference it as a `file` resource


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.autocontentapi.com/quick-start/documents/create-document.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
