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

# Update a scheduled post

> Replace the content, targets or schedule of a post that has not published.



## OpenAPI

````yaml /openapi.yaml patch /v1/posts/{postId}
openapi: 3.1.0
info:
  title: Nylon API
  version: 1.0.0
  description: |
    One API for publishing to twelve social networks.

    You address a post to connected profile ids; Nylon knows which network each
    one belongs to, what that network accepts, and how to get the media there.
    Character limits, media specs, upload protocols and threading rules are
    normalised before the request reaches a platform, and every failure comes
    back in one error taxonomy.

    ## Conventions

    - Request and response fields are `snake_case`.
    - Successful responses wrap the payload in `data`. List responses add
      `meta.pagination`.
    - Failures return `{ "error": { "code", "message", "details?" } }`.
      Branch on `code`; `message` is written for humans and may change.
    - Times are ISO 8601 with a `Z` offset.
    - Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and
      `RateLimit-Reset`. A `429` carries those plus `Retry-After`.
servers:
  - url: https://api.nylon.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Posts
    description: Create, schedule, inspect, edit and retry posts.
  - name: Profiles
    description: Social profiles connected to the authenticated Nylon account.
  - name: Connections
    description: Start a connection and see which networks are available.
  - name: Networks
    description: What each network accepts, as data.
  - name: Validation
    description: Dry-run a post without publishing it.
  - name: Webhooks
    description: Endpoints Nylon calls when a post finishes or a profile stops working.
paths:
  /v1/posts/{postId}:
    parameters:
      - $ref: '#/components/parameters/PostId'
    patch:
      tags:
        - Posts
      summary: Update a scheduled post
      description: |
        Edits a post that has not gone out yet.

        `publish_now`, or a `scheduled_at` inside the immediate window, sends
        the post from this call — the same rule `POST /v1/posts` follows.
        `scheduled_at: null` un-schedules it instead, leaving a draft.

        Content fields are **replaced, not merged**: sending `text` alone means
        "this is the text now". A deep merge would make it impossible to clear
        media or a link.

        A post that is publishing or has already published cannot be edited.
      operationId: updatePost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePostRequest'
            examples:
              reschedule:
                summary: Move the send time
                value:
                  scheduled_at: '2026-09-15T08:30:00.000Z'
              rewrite:
                summary: Replace the caption and drop the media
                value:
                  text: Rewritten caption.
                  media: []
      responses:
        '200':
          description: The updated post.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The post is publishing or has already published.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    PostId:
      name: postId
      in: path
      required: true
      description: The Nylon id of the post.
      schema:
        type: string
        example: cly7q9v2m0001x8b3a1c4d0dd
  schemas:
    UpdatePostRequest:
      type: object
      description: |
        Every field of `CreatePostRequest`, all optional. Content fields are
        replaced rather than merged.
      properties:
        profile_ids:
          type: array
          minItems: 1
          items:
            type: string
        text:
          type: string
          maxLength: 20000
        media:
          type: array
          maxItems: 35
          items:
            $ref: '#/components/schemas/MediaInput'
        link:
          oneOf:
            - $ref: '#/components/schemas/LinkInput'
            - type: 'null'
        post_type:
          type: string
          enum:
            - post
            - reel
            - story
        title:
          type:
            - string
            - 'null'
          maxLength: 300
        thread:
          type:
            - array
            - 'null'
          maxItems: 50
          items:
            type: string
        auto_thread:
          type: boolean
        scheduled_at:
          type:
            - string
            - 'null'
          format: date-time
        publish_now:
          type: boolean
        networks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NetworkOverride'
    PostResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/Post'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    MediaInput:
      description: A URL, or an object when you want alt text or a video cover.
      oneOf:
        - type: string
          format: uri
          example: https://cdn.example.com/launch.jpg
        - type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
            alt:
              type:
                - string
                - 'null'
              maxLength: 1000
              description: Alt text, on the networks that accept it.
            thumbnail_url:
              type:
                - string
                - 'null'
              format: uri
              description: Cover image for a video, where the network accepts one.
            mime_type:
              type:
                - string
                - 'null'
              description: Skips the probe when the host will not answer a HEAD request.
    LinkInput:
      description: A URL, or an object to control the preview card.
      oneOf:
        - type: string
          format: uri
        - type: object
          required:
            - url
          properties:
            url:
              type: string
              format: uri
            title:
              type:
                - string
                - 'null'
            description:
              type:
                - string
                - 'null'
            image_url:
              type:
                - string
                - 'null'
              format: uri
    NetworkOverride:
      type: object
      description: |
        Per-network overrides. The content keys below replace the base values
        for that network only; every other key is passed through to the
        publisher, because the option set differs per network. `GET
        /v1/networks` lists the options each one reads.
      additionalProperties: true
      properties:
        text:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
        media:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/MediaInput'
        thread:
          type:
            - array
            - 'null'
          items:
            type: string
        post_type:
          type:
            - string
            - 'null'
          enum:
            - post
            - reel
            - story
            - null
      example:
        board_id: '881573081235'
        title: Launch day
    Post:
      type: object
      required:
        - id
        - status
        - text
        - media
        - post_type
        - auto_thread
        - source
        - created_at
        - updated_at
        - targets
      properties:
        id:
          type: string
          example: cly7q9v2m0001x8b3a1c4d0dd
        status:
          type: string
          description: |
            Derived from the targets. `partially_published` means some
            networks took it and some did not — retry the rest.
          enum:
            - draft
            - scheduled
            - publishing
            - published
            - partially_published
            - failed
            - cancelled
          example: published
        text:
          type: string
        media:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        link:
          oneOf:
            - $ref: '#/components/schemas/Link'
            - type: 'null'
        post_type:
          type: string
          enum:
            - post
            - reel
            - story
        title:
          type:
            - string
            - 'null'
        thread:
          type:
            - array
            - 'null'
          items:
            type: string
        auto_thread:
          type: boolean
        networks:
          type: object
          description: The per-network overrides this post was created with.
          additionalProperties: true
        scheduled_at:
          type:
            - string
            - 'null'
          format: date-time
        published_at:
          type:
            - string
            - 'null'
          format: date-time
        source:
          type: string
          description: Where the post came from.
          example: api
        idempotency_key:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        targets:
          type: array
          items:
            $ref: '#/components/schemas/PostTarget'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: The stable identifier to branch on.
          enum:
            - invalid_request
            - unauthorized
            - payment_required
            - forbidden
            - not_found
            - conflict
            - rate_limited
            - unsupported
            - publish_failed
            - internal_error
          example: unauthorized
        message:
          type: string
          description: Written for humans. Do not match on it.
          example: A valid Nylon API key is required.
        details:
          type: array
          description: Present when the failure has a per-field or per-network breakdown.
          items:
            $ref: '#/components/schemas/ErrorDetail'
    Media:
      type: object
      required:
        - url
        - type
      properties:
        url:
          type: string
          format: uri
        type:
          type: string
          enum:
            - image
            - video
            - gif
          description: Resolved from the file, not from the extension.
        mime_type:
          type: string
          example: image/jpeg
        size_bytes:
          type:
            - integer
            - 'null'
          description: Null when the host refuses HEAD and sends no length.
        alt:
          type:
            - string
            - 'null'
        thumbnail_url:
          type:
            - string
            - 'null'
          format: uri
    Link:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        title:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
          format: uri
    PostTarget:
      type: object
      description: One post, on one profile. A post's own status is derived from these.
      required:
        - id
        - profile_id
        - network
        - profile_name
        - status
        - post_ids
        - attempts
      properties:
        id:
          type: string
          example: cly7q9v2m0002x8b3b5e6f0ee
        profile_id:
          type: string
          example: cly7p2q4k0001x8b3f2n9d0aa
        network:
          $ref: '#/components/schemas/Network'
        profile_name:
          type: string
          description: The profile's name as it was when the post was created.
          example: Nylon Studio
        status:
          type: string
          enum:
            - pending
            - publishing
            - published
            - failed
            - skipped
          example: published
        post_ids:
          type: array
          description: >-
            The network's own ids for what was published. More than one when the
            post was threaded.
          items:
            type: string
          example:
            - '17924418112233445'
        url:
          type:
            - string
            - 'null'
          format: uri
          description: Permalink to the published post, where the network returns one.
        attempts:
          type: integer
          description: How many times publishing this target has been attempted.
          example: 1
        published_at:
          type:
            - string
            - 'null'
          format: date-time
        error:
          type:
            - object
            - 'null'
          description: Why this target failed. Null while pending or once published.
          properties:
            code:
              type: string
              example: rejected_by_network
            message:
              type: string
              example: The caption contains a link this account is not allowed to post.
    ErrorDetail:
      type: object
      required:
        - message
      properties:
        field:
          type: string
          description: The request field the problem is about.
          example: profile_ids
        network:
          type: string
          description: The network the problem is about.
          example: instagram
        code:
          type: string
          description: |
            Machine-readable identifier for this problem. On a per-network
            detail this is a publishing code: `invalid_request`,
            `unsupported`, `media_error`, `reauthentication_required`,
            `rejected_by_network`, `network_error`, `timeout`,
            `profile_unavailable` or `internal_error`.
          example: invalid_request
        message:
          type: string
          example: >-
            Instagram requires at least 1 media item — text-only posts are not
            supported.
    Network:
      type: string
      description: A network Nylon publishes to.
      enum:
        - facebook
        - instagram
        - x
        - linkedin
        - pinterest
        - bluesky
        - threads
        - tiktok
        - youtube
        - google_business
        - mastodon
        - discord
      example: instagram
  responses:
    InvalidRequest:
      description: The request body or query is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            badField:
              value:
                error:
                  code: invalid_request
                  message: The request body is not valid.
                  details:
                    - field: profile_ids
                      message: Address the post to at least one profile.
    Unauthorized:
      description: The bearer API key is missing, malformed or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingKey:
              value:
                error:
                  code: unauthorized
                  message: A valid Nylon API key is required.
    NotFound:
      description: No such resource on this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              value:
                error:
                  code: not_found
                  message: Post could not be found.
    RateLimited:
      description: |
        Too many requests for this API key. Reads allow 120 requests a minute;
        publishing endpoints allow 30, because each one costs real upstream
        calls. The limit is per key, not per IP.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            throttled:
              value:
                error:
                  code: rate_limited
                  message: Too many requests. Retry after the window resets.
    InternalError:
      description: Nylon encountered an unexpected error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  headers:
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        example: 47
    RateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
        example: 120
    RateLimitRemaining:
      description: Requests left in the current window.
      schema:
        type: integer
        example: 119
    RateLimitReset:
      description: Seconds until the window resets.
      schema:
        type: integer
        example: 47
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Nylon API key
      description: An API key beginning with `nylon_live_`.

````