Skip to Content

Edit

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

Replaces the slides of a post you made through the API (generate or 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 using it show the new content.

It runs as import does: the edit gets an embedPostId of its own, then Check Post Status and 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, change its slides, send them back here.

Headers

  • Content-Type: application/json
  • embed-api-key: your-api-key-here (required)

Request Body

FieldTypeRequiredDescription
embedPostIdstringYesThe post to edit: the embedPostId that generate or import returned, or one an earlier edit of it returned
slidesarray | objectYesThe new slides, all of them, as import takes them for the design’s post type: an array of typed slides for a CAROUSEL or VIDEO, one object for an IMAGE
templateIdstringNoA new template 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
brandIdstringNoA new brand for the design: its name, handle and picture replace the branding’s. Leave it out to keep the design’s
responseTypestringNoDESIGN (the default), PDF or PNG; for a VIDEO, MP4 or DESIGN
requestorIdstringNoYour own tracking id
generateImagesobjectNoAI images, as on import: see AI Image Generation
videoSettingsobjectNoVIDEO only: a new motionStyle, sequenceId, backgroundMusicId, backgroundMusicVolume or voiceover, as on import: see Video Motion, Background music and 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.

Example Request

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

{ "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 takes.

Example: another template and brand

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

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

List Templates and List Brands give their ids. Read a Post 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’s credits for the edit is what the edit cost.

A narrated video’s new voiceover costs AI tokens, not credits.

Errors

Refused with a 422 before anything is made or charged:

MessageWhen
Post id is requiredNo 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 configurationNo 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 and Voiceover. 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.

Last updated on