> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Change a carousel

> Add, redraw, remove or move slides. 10 credits per slide added or redrawn (only for slides that succeed), at most 50 per change; removing and moving are free.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/workspaces/{workspaceId}/carousels/{id}/changes
openapi: 3.1.0
info:
  title: PostChamp API
  version: 1.0.0
  description: >-
    Write, schedule and manage LinkedIn posts, content styles, carousels and
    infographics from your own tools. Calls run as the key's creator with their
    current role and use the organization's credits. Lists are `{ items,
    nextCursor }`; errors are `{ error: { code, message, details } }`. Every
    response carries `X-Request-Id`, `RateLimit-Limit`, `RateLimit-Remaining`
    and `RateLimit-Reset`; a 429 adds `Retry-After`. Calls that spend credits
    require an `Idempotency-Key` header, and a replayed answer carries
    `Idempotent-Replayed: true`.
servers:
  - url: https://api.postchampai.com
security: []
tags:
  - name: Account
  - name: Posts
  - name: Scheduling
  - name: Content styles
  - name: Carousels
  - name: Infographics
  - name: Jobs
paths:
  /api/v1/workspaces/{workspaceId}/carousels/{id}/changes:
    post:
      tags:
        - Carousels
      summary: Change a carousel
      description: >-
        Add, redraw, remove or move slides. 10 credits per slide added or
        redrawn (only for slides that succeed), at most 50 per change; removing
        and moving are free.
      operationId: changeCarousel
      parameters:
        - schema:
            type: string
            format: uuid
            example: 7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f
          required: true
          name: workspaceId
          in: path
        - schema:
            type: string
            format: uuid
            example: 7d2c3f4e-9a0b-4c5d-8e6f-1a2b3c4d5e6f
          required: true
          name: id
          in: path
        - schema:
            type: string
            description: >-
              Required. ≤ 100 printable characters. A retry with the same key
              and body returns the first answer and is never charged twice; the
              same key with another body → 409 `idempotency_conflict`. Answers
              are kept 24 h.
            example: order-8812-post-1
          required: true
          description: >-
            Required. ≤ 100 printable characters. A retry with the same key and
            body returns the first answer and is never charged twice; the same
            key with another body → 409 `idempotency_conflict`. Answers are kept
            24 h.
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ops:
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - add
                          prompt:
                            type: string
                            maxLength: 50000
                          position:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - op
                          - prompt
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - redraw
                          slideId:
                            type: string
                            format: uuid
                          instruction:
                            type: string
                            maxLength: 50000
                          referenceObjectIds:
                            type: array
                            items:
                              type: string
                              format: uuid
                            maxItems: 20
                        required:
                          - op
                          - slideId
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - remove
                          slideId:
                            type: string
                            format: uuid
                        required:
                          - op
                          - slideId
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - move
                          slideId:
                            type: string
                            format: uuid
                          toPosition:
                            type: integer
                            minimum: 0
                            maximum: 1000
                        required:
                          - op
                          - slideId
                          - toPosition
                        additionalProperties: false
                  minItems: 1
                  maxItems: 40
                expectedRevision:
                  type: integer
                  minimum: 0
              required:
                - ops
              additionalProperties: false
      responses:
        '202':
          description: Queued. Follow `jobId` or poll the carousel.
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
            Idempotent-Replayed:
              description: >-
                Present with the value `true` when this answer is the stored
                result of an earlier request with the same `Idempotency-Key`
                (nothing was run or charged again). Absent on a first answer.
              schema:
                type: string
                enum:
                  - 'true'
          content:
            application/json:
              example:
                id: 5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c
                carouselId: 5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c
                jobId: carousel-build:5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c:1
                status: queued
                revision: 1
                ops:
                  - op: redraw
                    slideId: 22222222-aaaa-4bbb-8ccc-dddddddddddd
                    instruction: Use a warmer background.
                paidSlides: 1
                upTo: 10
              schema:
                $ref: '#/components/schemas/CarouselChangeStarted'
        '400':
          description: >-
            Invalid input (`validation_error`, `idempotency_key_required`,
            `linkedin_not_connected`, …).
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `api_key_required` (no `x-api-key`) or `api_key_invalid` (unknown,
            revoked or expired key, or its creator left the organization).
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            `subscription_required` (trial ended or no live subscription) or
            `insufficient_credits`.
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `plan_limit` (the plan lacks `api_access`, or a daily cap was
            reached) or `forbidden` (the key's role can't do this).
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`not_found`: the id does not exist or the key can''t reach it.'
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Conflict: `post_locked`, `idempotency_conflict`, or `conflict` with
            `details.reason` (`request_in_progress`, `already_done`,
            `item_moved`, …).
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            `rate_limited`; see `Retry-After`. The body's `error.details` is `{
            retryAfterSeconds, scope? }`: `retryAfterSeconds` is the wait in
            seconds (same as the `Retry-After` header) and `scope` names the
            limit that tripped (`api_global`, `api_apiKey`,
            `api_apiKeyGenerate`, …).
          headers:
            X-Request-Id:
              description: >-
                Id of this request. Quote it when you contact support; 5xx
                bodies repeat it as `details.requestId`.
              schema:
                type: string
                example: req_8f3a2c1e9b7d4a60
            RateLimit-Limit:
              description: >-
                Calls allowed in the current per-minute window (the window with
                the fewest calls left).
              schema:
                type: integer
                example: 120
            RateLimit-Remaining:
              description: Calls left in the current window.
              schema:
                type: integer
                example: 117
            RateLimit-Reset:
              description: Seconds until the window resets.
              schema:
                type: integer
                example: 42
            Retry-After:
              description: >-
                Seconds to wait before retrying (same value as
                `error.details.retryAfterSeconds`).
              schema:
                type: integer
                example: 12
          content:
            application/json:
              example:
                error:
                  code: rate_limited
                  message: Too many requests. Try again soon.
                  details:
                    retryAfterSeconds: 12
                    scope: api_apiKey
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    CarouselChangeStarted:
      type: object
      properties:
        carouselId:
          type: string
        jobId:
          type: string
        revision:
          type: integer
        ops:
          type: array
          items:
            $ref: '#/components/schemas/CarouselOp'
        paidSlides:
          type: integer
          description: Slides added or redrawn (10 credits each, capped).
        upTo:
          type: integer
          description: The most it can cost (charged only for slides that succeed).
        id:
          type: string
        status:
          type: string
          enum:
            - queued
      required:
        - carouselId
        - jobId
        - revision
        - ops
        - paidSlides
        - upTo
        - id
        - status
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
            message:
              type: string
              example: Workspace not found.
            details: {}
          required:
            - code
            - message
      required:
        - error
      description: >-
        Every error has this shape. 5xx answers carry `details.requestId`; every
        answer has an `X-Request-Id` header.
    CarouselOp:
      oneOf:
        - type: object
          properties:
            op:
              type: string
              enum:
                - add
            prompt:
              type: string
            position:
              type: integer
          required:
            - op
            - prompt
            - position
        - type: object
          properties:
            op:
              type: string
              enum:
                - redraw
            slideId:
              type: string
            instruction:
              type:
                - string
                - 'null'
            referenceObjectIds:
              type: array
              items:
                type: string
          required:
            - op
            - slideId
            - instruction
        - type: object
          properties:
            op:
              type: string
              enum:
                - remove
            slideId:
              type: string
          required:
            - op
            - slideId
        - type: object
          properties:
            op:
              type: string
              enum:
                - move
            slideId:
              type: string
            toPosition:
              type: integer
          required:
            - op
            - slideId
            - toPosition
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Send your API key in the `x-api-key` header on every request.


        - Create a key in PostChamp under **Settings → API keys**. API access
        needs the Studio plan.

        - Keys start with `pc_live_`. The full key is shown **once**, when you
        create it: copy it then. Afterwards only its prefix is shown; lost keys
        are revoked and replaced.

        - Calls run as the person who created the key, with their current role,
        and spend the organization's credits.

        - Limits per key: 120 requests per minute, 20 generation calls per
        minute. Keep the key on your server, never in a browser or app.

````