Carousels & Infographics

Edit carousel slide

Edits one slide (or, for an infographic, the single canvas at slideIndex 0) via a natural-language instruction. Postiv's slide-edit agent rewrites the HTML; saves as a new carousel version.

POST/api/public/carousels/:id/edit-slide
cURLPOST /api/public/carousels/:id/edit-slide
curl -X POST https://postiv.ai/api/public/carousels/ID_ID/edit-slide \
  -H "Authorization: Bearer pk_postiv_..." \
  -H "Content-Type: application/json" \
  -d '{
    "slideIndex": 123,
    "instruction": "..."
  }'
200Response
{
  "success": true,
  "carouselId": "car1...",
  "versionId": "cv2...",
  "versionNumber": 2,
  "slideIndex": 0,
  "deduped": false,
  "summary": "Shortened the headline and darkened the background",
  "slide": {
    "index": 0,
    "title": "5 Content Mistakes",
    "textPreview": "Most B2B content fails..."
  }
}

Authorization

Requires an organization API key with the posts:write scope, sent as Authorization: Bearer or x-api-key.

Path parameters

idstringrequired

Resource id from the corresponding list or create endpoint.

Body parameters

slideIndexintrequired

0-based.

instructionstringrequired

1-4000 chars, e.g. 'shorten the headline to 5 words'.

Response

The edit result.

carouselIduuid
versionId / versionNumbermixed

New version unless deduped.

slideIndexint
dedupedboolean

true if the edit produced no meaningful change: no new version was saved.

summarystring

Agent's own summary of what changed.

slide.index / title / textPreviewmixed

Errors

400missing_instruction / invalid_slide_index / slide_not_editable
404carousel_not_found / slide_not_found
409carousel_locked: carousel is scheduled/published; unschedule first
409carousel_version_conflict: carousel changed concurrently during the edit; re-read and retry

Good to know

  • Only one slide per call. Takes 15-90+ seconds; the route timeout is 180s to allow a validation-repair retry on large imported-style slides (up to 24k output tokens).