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

# Edit a post

> Required permissions: posts-write. Editing a scheduled post or setting a non-null scheduledAt also requires posts-publish. Provide at least one field. Set scheduledAt to null to return an editable scheduled post to draft.



## OpenAPI

````yaml /api-reference/openapi.json patch /posts/{id}
openapi: 3.1.0
info:
  title: Postinger Public API
  version: 1.0.0
  description: >-
    Project-scoped API keys. JSON bodies up to 100 KB. Upload media directly to
    the returned R2 URL, then complete the upload. Rate limits are shared by all
    keys in the project. Scheduling requires posts-publish in addition to
    posts-write. A paused key returns 403 with error.code api_key_paused.
servers:
  - url: https://api.dev.postinger.dev/public/v1
security: []
paths:
  /posts/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Posts
      summary: Edit a post
      description: >-
        Required permissions: posts-write. Editing a scheduled post or setting a
        non-null scheduledAt also requires posts-publish. Provide at least one
        field. Set scheduledAt to null to return an editable scheduled post to
        draft.
      operationId: updatePost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePost'
      responses:
        '200':
          description: Success
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/Post'
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '400':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '401':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '403':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '404':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '409':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
            Retry-After:
              schema:
                type: integer
              description: Present for idempotency_in_progress; wait before retrying.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '413':
          description: >-
            JSON body exceeds the 100 KB limit. This can be rejected before the
            controller, so the public error envelope is not guaranteed.
        '429':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
            Retry-After:
              schema:
                type: integer
              description: Seconds before retrying.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '500':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
        '503':
          description: Request failed. Check error.code and meta.requestId.
          headers:
            X-Request-Id:
              schema:
                type: string
              description: Request identifier for troubleshooting.
            Cache-Control:
              schema:
                type: string
                const: no-store
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Project-wide limit, when supplied by the rate limiter.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Remaining project requests, when supplied by the rate limiter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - meta
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                      message:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                  meta:
                    type: object
                    required:
                      - requestId
                    properties:
                      requestId:
                        type: string
      security:
        - ApiKey: []
components:
  schemas:
    UpdatePost:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        content:
          type: string
          maxLength: 10000
        mediaIds:
          maxItems: 10
          type: array
          items:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        targets:
          maxItems: 20
          type: array
          items:
            type: object
            properties:
              socialAccountId:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              options:
                type: object
                properties:
                  format:
                    default: feed
                    type: string
                    enum:
                      - feed
                      - reel
                      - story
                  shareToFeed:
                    default: true
                    type: boolean
                  link:
                    type: string
                    maxLength: 2048
                    format: uri
                  youtubeTitle:
                    type: string
                    maxLength: 100
                  youtubeDescription:
                    type: string
                    maxLength: 5000
                  youtubePrivacy:
                    type: string
                    enum:
                      - private
                      - unlisted
                      - public
                  youtubeMadeForKids:
                    type: boolean
                  youtubeTags:
                    maxItems: 30
                    type: array
                    items:
                      type: string
                      minLength: 1
                      maxLength: 100
                  tiktokMode:
                    type: string
                    enum:
                      - direct
                      - inbox
                  tiktokCaption:
                    type: string
                    maxLength: 2200
                  tiktokPrivacy:
                    type: string
                    enum:
                      - PUBLIC_TO_EVERYONE
                      - MUTUAL_FOLLOW_FRIENDS
                      - FOLLOWER_OF_CREATOR
                      - SELF_ONLY
                  tiktokAllowComment:
                    type: boolean
                  tiktokAllowDuet:
                    type: boolean
                  tiktokAllowStitch:
                    type: boolean
                  tiktokDisclose:
                    type: boolean
                  tiktokBrandContent:
                    type: boolean
                  tiktokBrandOrganic:
                    type: boolean
                  tiktokIsAigc:
                    type: boolean
              contentOverride:
                anyOf:
                  - type: string
                    maxLength: 63206
                  - type: 'null'
            required:
              - socialAccountId
        scheduledAt:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
            - type: 'null'
      additionalProperties: false
      minProperties: 1
    Post:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        status:
          type: string
          enum:
            - draft
            - scheduled
            - publishing
            - partial
            - published
            - failed
        content:
          type: string
        scheduledAt:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
            - type: 'null'
        publishedAt:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
            - type: 'null'
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        updatedAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        targets:
          type: array
          items:
            type: object
            properties:
              socialAccountId:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              platform:
                type: string
                enum:
                  - instagram
                  - facebook
                  - youtube
                  - tiktok
              handle:
                type:
                  - string
                  - 'null'
              contentOverride:
                type:
                  - string
                  - 'null'
              options:
                type: object
                properties:
                  format:
                    type: string
                    enum:
                      - feed
                      - reel
                      - story
                  shareToFeed:
                    type: boolean
                  link:
                    type: string
                    maxLength: 2048
                    format: uri
                  youtubeTitle:
                    type: string
                    maxLength: 100
                  youtubeDescription:
                    type: string
                    maxLength: 5000
                  youtubePrivacy:
                    type: string
                    enum:
                      - private
                      - unlisted
                      - public
                  youtubeMadeForKids:
                    type: boolean
                  youtubeTags:
                    maxItems: 30
                    type: array
                    items:
                      type: string
                      minLength: 1
                      maxLength: 100
                  tiktokMode:
                    type: string
                    enum:
                      - direct
                      - inbox
                  tiktokCaption:
                    type: string
                    maxLength: 2200
                  tiktokPrivacy:
                    type: string
                    enum:
                      - PUBLIC_TO_EVERYONE
                      - MUTUAL_FOLLOW_FRIENDS
                      - FOLLOWER_OF_CREATOR
                      - SELF_ONLY
                  tiktokAllowComment:
                    type: boolean
                  tiktokAllowDuet:
                    type: boolean
                  tiktokAllowStitch:
                    type: boolean
                  tiktokDisclose:
                    type: boolean
                  tiktokBrandContent:
                    type: boolean
                  tiktokBrandOrganic:
                    type: boolean
                  tiktokIsAigc:
                    type: boolean
              status:
                type: string
                enum:
                  - pending
                  - publishing
                  - processing
                  - published
                  - failed
              externalPostId:
                type:
                  - string
                  - 'null'
              error:
                type:
                  - string
                  - 'null'
              waitReason:
                type:
                  - string
                  - 'null'
              nextAttemptAt:
                anyOf:
                  - type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  - type: 'null'
              publishedAt:
                anyOf:
                  - type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  - type: 'null'
            required:
              - socialAccountId
              - platform
              - handle
              - contentOverride
              - options
              - status
              - externalPostId
              - error
              - waitReason
              - nextAttemptAt
              - publishedAt
        media:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              kind:
                type: string
                enum:
                  - image
                  - video
              url:
                type: string
              posterUrl:
                type:
                  - string
                  - 'null'
              sourceAvailable:
                type: boolean
              contentType:
                type: string
              width:
                type:
                  - number
                  - 'null'
              height:
                type:
                  - number
                  - 'null'
              durationSeconds:
                type:
                  - number
                  - 'null'
            required:
              - id
              - kind
              - url
              - posterUrl
              - sourceAvailable
              - contentType
              - width
              - height
              - durationSeconds
      required:
        - id
        - status
        - content
        - scheduledAt
        - publishedAt
        - createdAt
        - updatedAt
        - targets
        - media
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: Postinger API key

````

## Related topics

- [Schedule and edit](/guides/scheduling.md)
- [Automate with the CLI](/cli/automation.md)
- [Authentication and permissions](/guides/authentication.md)
- [List posts](/api-reference/posts/list-posts.md)
- [Delete a post](/api-reference/posts/delete-a-post.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.