# Create a Briefing Document from Text

This snippet mirrors the [text-based document recipe](https://docs.autocontentapi.com/quick-start/documents/from-text) using Python.

```python
import os
import requests


token = os.getenv("AUTOCONTENT_TOKEN", "YOUR_API_TOKEN")
endpoint = "https://api.autocontentapi.com/content/Create"

payload = {
    "outputType": "briefing_doc",
    "format": "text",
    "resources": [
        {
            "type": "text",
            "content": "Q1 board memo: revenue growth slowed to 11%, enterprise expansion remains strongest, sales cycles increased by 18 days, and churn improved by 0.7 points.",
        }
    ],
    "text": "Create an executive briefing with summary, risks, and action items.",
    "language": "English",
}

response = requests.post(
    endpoint,
    headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
    json=payload,
    timeout=30,
)

if response.status_code >= 400:
    raise SystemExit(f"Request failed: {response.status_code} {response.text}")

print("Document request accepted:")
print(response.json())
```

Set `YOUR_API_TOKEN` (or `AUTOCONTENT_TOKEN`) before running.

**See also**

* [Scenario overview](https://docs.autocontentapi.com/quick-start/documents/from-text)
* [Python guide](https://docs.autocontentapi.com/code-samples/language-quickstarts/python)
