> ## 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 Using the API

> Edit an existing presentation in place using the edit endpoint.

In this guide, you'll learn how to create a brand new presentation by reusing an existing one as the starting point, then updating only the slides you need — all via the API.

<Note>
  If you haven't generated your first presentation yet, start with the
  [Generate Presentation Guide](using-presenton-api).
  You'll need at least one presentation ID to follow along.
</Note>

## What you'll do

* Create a new presentation from an existing presentation (by ID)
* Update one or more slides by index
* Download the updated file or continue editing in the web UI

## Endpoint

```http theme={null}
POST /api/v1/ppt/presentation/edit
```

This endpoint takes an existing `presentation_id`, applies your slide edits, and returns a new presentation.

<Warning>
  Slide indices are **zero-based**. The first slide is index `0`, the second is `1`, and so on.
</Warning>

## Before you start (optional but helpful)

Fetch your presentation to see current slide indices, content, and schema:

```http theme={null}
GET /api/v1/ppt/presentation/{id}
```

This response includes:

* `slides[].index`: which slide to target
* `slides[].content`: fields you can change

<Info>
  For field-by-field details, see the API reference page for

  <br />

  <code>
    POST /api/v1/ppt/presentation/edit
  </code>

  .
</Info>

## Step 1 — Decide what to change

Prepare a minimal list of edits. For example, update only the company name on slide `5`:

```json theme={null}
{
  "presentation_id": "b4fa04dc-0151-4a4d-a2e0-40a51d569afe",
  "slides": [
    {
      "index": 5,
      "content": {
        "companyName": "ABC Company"
      }
    }
  ],
  "export_as": "pptx"
}
```

## Step 2 — Send the request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.presenton.ai/api/v1/ppt/presentation/edit \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-presenton-xxxxx" \
    -d '{
      "presentation_id": "b4fa04dc-0151-4a4d-a2e0-40a51d569afe",
      "slides": [
        {
          "index": 5,
          "content": {
            "companyName": "ABC Company"
          }
        }
      ],
      "export_as": "pptx"
    }'
  ```

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

  payload = {
      "presentation_id": "b4fa04dc-0151-4a4d-a2e0-40a51d569afe",
      "slides": [
          {
              "index": 5,
              "content": {
                  "companyName": "ABC Company"
              }
          }
      ],
      "export_as": "pptx"
  }

  response = requests.post(
      "https://api.presenton.ai/api/v1/ppt/presentation/edit",
      json=payload,
      headers={"Authorization": "Bearer sk-presenton-xxxxx"}
  )

  if response.status_code == 200:
      result = response.json()
      print("✅ Presentation updated successfully!")
      print("New presentation ID:", result["presentation_id"])
      print("Download path:", result["path"]) 
  else:
      print("❌ Error:", response.status_code)
      print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const axios = require("axios");

  async function run() {
    try {
      const payload = {
        presentation_id: "b4fa04dc-0151-4a4d-a2e0-40a51d569afe",
        slides: [
          {
            index: 5,
            content: { companyName: "ABC Company" }
          }
        ],
        export_as: "pptx"
      };

      const { data } = await axios.post(
        "https://api.presenton.ai/api/v1/ppt/presentation/edit",
        payload,
        { headers: { Authorization: "Bearer sk-presenton-xxxxx" } }
      );

      console.log("✅ Presentation updated successfully!");
      console.log(data);
    } catch (error) {
      console.error("❌ Error:", error.response?.data || error.message);
    }
  }

  run();
  ```
</CodeGroup>

## Step 3 — Understand the response

```json theme={null}
{
  "presentation_id": "new_unique_presentation_id",
  "path": "/app_data/exports/ABC Company Presentation.pptx",
  "edit_path": "/presentation?id=new_unique_presentation_id"
}
```

* `presentation_id`: the new presentation's ID
* `path`: where the exported file is stored on the server
* `edit_path`: open this path in the web app to continue editing visually

<Tip>
  Use `edit_path` to fine-tune layouts, colors, and images in the visual editor.
</Tip>

## Update multiple slides (advanced)

```json theme={null}
{
  "presentation_id": "your_presentation_id",
  "slides": [
    { "index": 0, "content": { "title": "New Introduction Title" } },
    { "index": 2, "content": { "companyName": "Updated Company", "revenue": 2500000 } },
    { "index": 5, "content": { "bullets": ["Updated point 1", "Updated point 2", "Updated point 3"] } }
  ],
  "export_as": "pptx"
}
```

## Update complex data structures (advanced)

```json theme={null}
{
  "presentation_id": "your_presentation_id",
  "slides": [
    {
      "index": 3,
      "content": {
        "chartData": [
          {"quarter": "Q1", "revenue": 125000, "growth": 15},
          {"quarter": "Q2", "revenue": 143750, "growth": 18},
          {"quarter": "Q3", "revenue": 168125, "growth": 22},
          {"quarter": "Q4", "revenue": 201750, "growth": 25}
        ]
      }
    }
  ]
}
```

***

## Next steps

1. **Download and share**: Use the `path` to download the new file.
2. **Continue editing**: Open `edit_path` to make visual tweaks in the web editor.

<Card title="New to Presenton?" icon="rocket">
  Start with our [Generate Presentation Guide](./generate-presentation-over-api) to learn the basics.
</Card>
