> ## 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.

# Edit a presentation with the API

> Update selected slide-content fields in an existing Open Source presentation and export the result.

Use `POST /api/v1/ppt/presentation/edit` when the original presentation should be updated in place. The endpoint deep-merges the supplied content into the targeted slides, preserves every unlisted slide, exports the requested format, and returns the same presentation ID.

<Warning>
  This operation changes the stored presentation. Use [derive](/open-source/v0.9.0-beta/guides/derive-presentation) when the original must remain unchanged.
</Warning>

## Before you start

* Create or open a presentation and copy its ID.
* Use the admin username and password configured for the Open Source instance.
* Fetch `GET /api/v1/ppt/presentation/{id}` to inspect slide indices and current `content` objects.
* Remember that slide indices are zero-based.

For example, assume the first slide of a customer-success deck currently contains:

```json theme={null}
{
  "title": "Q2 Customer Business Review",
  "subtitle": "Northstar Logistics"
}
```

The examples below update that exact title and subtitle for the approved Q3 review. Replace these keys with the fields returned by your own presentation.

```bash theme={null}
export PRESENTON_URL=http://localhost:5001
export PRESENTON_USERNAME=admin
export PRESENTON_PASSWORD=YOUR_PASSWORD
export PRESENTATION_ID=REPLACE_WITH_PRESENTATION_ID
```

## Update selected fields

Each entry in `slides` identifies a slide by `index`. Its `content` object is merged into the existing content, so send only the fields that should change.

```bash theme={null}
curl --request POST \
  --url "$PRESENTON_URL/api/v1/ppt/presentation/edit" \
  --user "$PRESENTON_USERNAME:$PRESENTON_PASSWORD" \
  --header 'Content-Type: application/json' \
  --data "{
    \"presentation_id\": \"$PRESENTATION_ID\",
    \"slides\": [
      {
        \"index\": 0,
        \"content\": {
          \"title\": \"Q3 Customer Business Review\",
          \"subtitle\": \"Northstar Logistics — renewal and expansion plan\"
        }
      }
    ],
    \"export_as\": \"pptx\"
  }"
```

The response contains the existing presentation ID and fresh export paths:

```json theme={null}
{
  "presentation_id": "b4fa04dc-0151-4a4d-a2e0-40a51d569afe",
  "path": "/app_data/exports/Q3 Customer Business Review.pptx",
  "edit_path": "/presentation?id=b4fa04dc-0151-4a4d-a2e0-40a51d569afe"
}
```

Prepend `PRESENTON_URL` when a returned path is relative.

## Python example

```python theme={null}
import os
import requests

base_url = os.environ.get("PRESENTON_URL", "http://localhost:5001")
auth = (
    os.environ["PRESENTON_USERNAME"],
    os.environ["PRESENTON_PASSWORD"],
)

payload = {
    "presentation_id": os.environ["PRESENTATION_ID"],
    "slides": [
        {
            "index": 0,
            "content": {
                "title": "Q3 Customer Business Review",
                "subtitle": "Northstar Logistics — renewal and expansion plan",
            },
        },
    ],
    "export_as": "pptx",
}

response = requests.post(
    f"{base_url}/api/v1/ppt/presentation/edit",
    json=payload,
    auth=auth,
    timeout=600,
)
response.raise_for_status()
print(response.json())
```

## Edit safely

* Read the presentation first instead of guessing content-field names.
* Send the smallest possible patch; unrelated fields remain unchanged.
* Verify chart and table structures before replacing nested values.
* Export and review the result after every automated edit.
* Avoid concurrent edits to the same presentation unless your application coordinates them.

<Card title="Create a copy instead" icon="copy" href="/open-source/v0.9.0-beta/guides/derive-presentation">
  Derive a new presentation and preserve the source deck.
</Card>
