> ## Documentation Index
> Fetch the complete documentation index at: https://docs.draftliftai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Content

> Generate content with a single API call.

## Single-call generation

The simplest way to generate content — just pass a `template_id` and `user_direction`:

```bash theme={null}
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing"
  }'
```

The API auto-creates a content record and returns its `content_id` in the response. Use this ID for all downstream operations (retrieve, edit, finalize).

## With memories and references

Attach memories for voice/context and reference materials for source content:

```bash theme={null}
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing",
    "memory_ids": [1, 5, 12],
    "reference_material_ids": [3]
  }'
```

## Generate against an existing draft

If you've already created a content record (via the dashboard or [Create Content](/api-reference/contents/create)), pass its `content_id`:

```bash theme={null}
curl -X POST https://draftliftai.com/api/v1/generate \
  -H "Authorization: Bearer dl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content_id": 123,
    "template_id": 1,
    "user_direction": "Write about AI transforming content marketing"
  }'
```

## Next steps

After generation, [retrieve the content](/api-reference/contents/get) to review it, then [finalize](/api-reference/finalize) to save your edited version and trigger learning analysis.
