---
title: Edit a Post - Replace a Design's Slides
description: Edit a post made through the PostNitro Embed API in place, by its embedPostId - its slides replaced as import takes them, at 1 credit per slide.
canonical: https://postnitro.ai/docs/embed/api/edit
---

# Edit

**POST** `https://embed-api.postnitro.ai/post/edit`

Replaces the slides of a post you made through the API ([generate](https://postnitro.ai/docs/embed/api/initiate/generate) or [import](https://postnitro.ai/docs/embed/api/initiate/import)) with new ones, written as import takes them. You name the post by the **`embedPostId`** its request gave you. Its design is changed **in place**: it keeps its `designId`, so the editor and any [scheduled post](https://postnitro.ai/docs/embed/api/schedule) using it show the new content.

It runs as import does: the edit gets an `embedPostId` of its own, then [Check Post Status](https://postnitro.ai/docs/embed/api/request-status) and [Post Output](https://postnitro.ai/docs/embed/api/post-output) serve it, the output with the re-rendered file when you ask for one. That new `embedPostId` names the same post too, so you can read or edit it again by either.

The usual way: [read the post](https://postnitro.ai/docs/embed/api/read-design), change its slides, send them back here.

#### Headers
- `Content-Type: application/json`
- `embed-api-key: your-api-key-here` (required)

#### Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `embedPostId` | string | Yes | The post to edit: the `embedPostId` that generate or import returned, or one an earlier edit of it returned |
| `slides` | array \| object | Yes | The new slides, all of them, as [import](https://postnitro.ai/docs/embed/api/initiate/import) takes them for the design's post type: an array of typed slides for a `CAROUSEL` or `VIDEO`, one object for an `IMAGE` |
| `templateId` | string | No | A new [template](https://postnitro.ai/docs/embed/api/templates) for the design: the new slides take its look and size, as an import with it would make them. Leave it out to keep the design's |
| `brandId` | string | No | A new [brand](https://postnitro.ai/docs/embed/api/brands) for the design: its name, handle and picture replace the branding's. Leave it out to keep the design's |
| `responseType` | string | No | `DESIGN` (the default), `PDF` or `PNG`; for a `VIDEO`, `MP4` or `DESIGN` |
| `requestorId` | string | No | Your own tracking id |
| `generateImages` | object | No | AI images, as on import: see [AI Image Generation](https://postnitro.ai/docs/embed/api/initiate/import#ai-image-generation) |
| `videoSettings` | object | No | `VIDEO` only: a new `motionStyle`, `sequenceId`, `backgroundMusicId`, `backgroundMusicVolume` or `voiceover`, as on import: see [Video Motion](https://postnitro.ai/docs/embed/api/initiate/video-motion), [Background music](https://postnitro.ai/docs/embed/api/initiate/import#background-music) and [Voiceover](https://postnitro.ai/docs/embed/api/initiate/voiceover). `audioId`, the older name of `backgroundMusicId`, is still accepted |

There's no `postType`: the design keeps its own, and its post type decides the shape of `slides`. And no `designId`: the post names it.

#### What changes, and what stays

- **The slides are replaced**, every one, by those you send. Send the slides you want to keep too.
- **The design keeps** its name, and its template's look, its size and its brand unless you give a new `templateId` or `brandId`.
- **A new template** lays the new slides out in its look and size, as an import with that template would, and the design keeps its name and brand. **A new brand** replaces the branding's name, handle and picture, and keeps how the design shows them. Either is the design's from then on, so the next edit keeps it. A video keeps its motion style, music and voiceover across a new template, as below.
- **A video keeps** its motion style, its music and its voiceover unless `videoSettings` gives new ones, field by field. Its motion is put on the new slides again, so it runs as long as they now take.
- **Its music:** a new `backgroundMusicId` replaces the track and keeps the old one's volume and fade, unless `backgroundMusicVolume` gives a volume. A `backgroundMusicVolume` alone sets the volume of the music the video already has.
- **A narrated video is narrated again:** its new slides, in its voice and tone, charged again in AI tokens. `voiceover` fields change just those, and `"voiceover": false` takes the narration off. See [Editing a narrated video](https://postnitro.ai/docs/embed/api/initiate/voiceover#editing-a-narrated-video).

#### Example Request

```bash
curl --location 'https://embed-api.postnitro.ai/post/edit' \
--header 'Content-Type: application/json' \
--header 'embed-api-key: pn-your-api-key' \
--data '{
    "embedPostId": "post123",
    "responseType": "PDF",
    "slides": [
        {
            "type": "starting_slide",
            "sub_heading": "Remote work",
            "heading": "Two habits, done well"
        },
        {
            "type": "body_slide",
            "heading": "Write it down",
            "description": "In one place everyone reads."
        },
        {
            "type": "ending_slide",
            "heading": "Start today",
            "cta_button": "Follow for more"
        }
    ]
}'
```

#### Response

```json
{
    "success": true,
    "message": "CAROUSEL edit initiated",
    "data": {
        "embedPostId": "post456",
        "designId": "design123",
        "status": "PENDING"
    }
}
```

`embedPostId` is the edit's own: check its status and fetch its output with it. `designId` is the post's design, unchanged, the one [scheduling](https://postnitro.ai/docs/embed/api/schedule) takes.

#### Example: another template and brand

The same edit, moving the design to another template and brand as well:

```json
{
    "embedPostId": "post123",
    "templateId": "xtrnxgfgk9a08tmsz2601k1c",
    "brandId": "cmdhb8oe10006v0pmh6a4no6t",
    "slides": [ ... ]
}
```

[List Templates](https://postnitro.ai/docs/embed/api/templates) and [List Brands](https://postnitro.ai/docs/embed/api/brands) give their ids. [Read a Post](https://postnitro.ai/docs/embed/api/read-design) gives the template the design was last made with (`templateId`) and its brand (`brand.id`).

## Credits

An edit costs what an import of the same slides does: **1 credit per slide** you send (an image, 1). It's charged to the edit itself, in the billing period you make it, and checked against your plan before it runs. The design's earlier credits aren't charged again. [Post Output](https://postnitro.ai/docs/embed/api/post-output)'s `credits` for the edit is what the edit cost.

A narrated video's new [voiceover](https://postnitro.ai/docs/embed/api/initiate/voiceover#what-it-costs) costs AI tokens, not credits.

## Errors

Refused with a `422` before anything is made or charged:

| Message | When |
|---------|------|
| `Post id is required` | No `embedPostId` |
| `The post does not exist.` | No such post for your API key: a `designId` given instead, or another workspace's post |
| `This post has no design yet: it's still being made, or it failed before making one.` | The post's request hasn't made its design: wait until it's `COMPLETED` |
| `The template does not exists.` / `The brand does not exists.` | A `templateId` or `brandId` that isn't one of your workspace's |
| `Slides are required` / `Invalid slides configuration` | No `slides`, or slides that don't fit the design's post type: one `starting_slide`, at least one `body_slide` and one `ending_slide` for a carousel or video, one object for an image |
| `Response type for VIDEO posts must be 'MP4' or 'DESIGN'` | `PDF` or `PNG` for a video |
| `Extra parameters passed in the body.` | Any other field, `designId` and `postType` included |

A mistake in `videoSettings` returns the same `422` as on import: see [Background music](https://postnitro.ai/docs/embed/api/initiate/import#background-music) and [Voiceover](https://postnitro.ai/docs/embed/api/initiate/voiceover#errors). On an edit, a `backgroundMusicVolume` needs no `backgroundMusicId`.

A plan that doesn't allow the edit fails the post the way import does: see [Check Post Status](https://postnitro.ai/docs/embed/api/request-status).
