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

# Generate from documents

> Upload source files through the Cloud API and use them to create a grounded presentation.

Use file-based generation when a presentation must follow an existing report, proposal, brief, spreadsheet, or other source. The API workflow has two requests: upload the files, then pass the returned values to presentation generation.

## Supported source formats

The upload workflow supports PDF, Word, PowerPoint, Excel, CSV, plain text, Markdown, HTML, and AsciiDoc files. See [Create from documents](/cloud/features/document-extraction) for the complete extension list and recommended uses.

## 1. Upload the source files

Send one or more files as multipart form data to `POST /files/upload`:

```bash theme={null}
curl --request POST \
  --url https://api.presenton.ai/api/v3/files/upload \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --form "files=@./quarterly-report.pdf" \
  --form "files=@./customer-metrics.xlsx"
```

The response is an array of file values:

```json theme={null}
[
  "uploaded-file-value-1",
  "uploaded-file-value-2"
]
```

Treat each returned string as opaque. Preserve it exactly and pass it back in the `files` array; do not construct or modify file values in your application.

## 2. Generate the presentation

Use the uploaded values in a synchronous or asynchronous generation request. Add `content` or `instructions` to explain which parts of the sources matter most.

```bash theme={null}
curl --request POST \
  --url https://api.presenton.ai/api/v3/presentation/generate \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "files": [
      "uploaded-file-value-1",
      "uploaded-file-value-2"
    ],
    "content": "Create an executive quarterly review from the attached report and metrics workbook",
    "instructions": "Prioritize revenue, retention, major risks, and next-quarter actions. Preserve reported figures exactly.",
    "n_slides": 8,
    "language": "English",
    "tone": "professional",
    "content_generation": "condense",
    "standard_template": "neo-modern",
    "export_as": "pptx"
  }'
```

## Choose how source content is handled

The `content_generation` field controls how aggressively Presenton changes the source material:

| Value      | Use it when                                                            |
| ---------- | ---------------------------------------------------------------------- |
| `preserve` | Wording and source structure should remain close to the original       |
| `enhance`  | Presenton may add explanation or improve how the material is presented |
| `condense` | A long source must become a shorter presentation                       |

Whatever mode you choose, verify all important facts and calculations against the source.

## Review the outline first

For sensitive or complex material, send the same `files`, `content`, and controls to `POST /presentation/outlines/generate`. The response is a slide-by-slide array of outline strings. Review those strings before passing them to `slides` in the final generation request.

This two-stage approach is useful when:

* An approver must confirm the story before design and export.
* Several documents contain overlapping information.
* The deck must follow a fixed narrative or decision sequence.
* You need to remove confidential or irrelevant outline sections before generation.

## Use asynchronous generation for larger jobs

Change the endpoint to `POST /presentation/generate/async` when file processing and presentation generation should run in the background. Store the returned task identifier and follow [Generate asynchronously](/cloud/guides/async-generation).

## Production checklist

* Validate file extensions and sizes before upload so users receive immediate feedback.
* Sanitize filenames in your own logs and interfaces.
* Do not send confidential sources unless your organization has approved the workflow.
* Keep uploaded file values associated with the correct user and job.
* Set timeouts independently for upload and presentation generation.
* Verify names, dates, figures, charts, and tables in the final deck.
* Remove local temporary copies according to your application's retention policy.

<Card title="Document tutorial" icon="file-lines" href="/cloud/tutorials/create-from-document">
  See the equivalent upload, outline, and review workflow in the Presenton Cloud interface.
</Card>
