> ## 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.

# Create a post

> Publish or schedule one payload across every connected profile you address.



## OpenAPI

````yaml /openapi.yaml post /v1/posts
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:
    post:
      tags:
        - Posts
      summary: Create a post
      description: |
        Publishes to every profile in `profile_ids`, or schedules the post when
        `scheduled_at` is in the future.

        Publishing is **synchronous**: when the post goes out now, the response
        is returned after every target has been attempted and carries the
        result — post ids, permalinks and per-target errors — rather than a job
        id to poll. A carousel to Instagram plus a video to LinkedIn can take
        minutes.

        The post is validated against every addressed network before anything
        is sent. If it is invalid anywhere, nothing publishes and a `400` lists
        the problem per network.

        Send `idempotency_key` to make retries safe: a replay returns the
        original post untouched, with `Idempotent-Replay: true`, whatever the
        replayed body says.
      operationId: createPost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePostRequest'
            examples:
              publishNow:
                summary: Publish immediately to two profiles
                value:
                  profile_ids:
                    - cly7p2q4k0001x8b3f2n9d0aa
                    - cly7p2q4k0002x8b3h4m1e0bb
                  text: Shipping day. The new editor is live for everyone.
                  media:
                    - url: https://cdn.example.com/launch.jpg
                      alt: The new editor, open on a draft post
              schedule:
                summary: Schedule for later
                value:
                  profile_ids:
                    - cly7p2q4k0001x8b3f2n9d0aa
                  text: Doors open at 09:00.
                  scheduled_at: '2026-09-14T07:00:00.000Z'
                  idempotency_key: launch-announcement-2026-09-14
              perNetwork:
                summary: Override content for one network
                value:
                  profile_ids:
                    - cly7p2q4k0001x8b3f2n9d0aa
                    - cly7p2q4k0003x8b3j6k2f0cc
                  text: Long-form caption for the feed networks.
                  networks:
                    x:
                      text: Short version for X.
                    pinterest:
                      board_id: '881573081235'
                      title: Launch day
      responses:
        '200':
          description: An idempotent replay. The original post is returned unchanged.
          headers:
            Idempotent-Replay:
              description: >-
                Present and `true` when this response replays an earlier
                request.
              schema:
                type: string
                example: 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
        '201':
          description: |
            The post was created. When it published immediately, `targets`
            carries the per-network outcome and `status` is `published`,
            `partially_published` or `failed`.
          headers:
            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/PostResponse'
              examples:
                published:
                  summary: Published to two networks
                  value:
                    data:
                      id: cly7q9v2m0001x8b3a1c4d0dd
                      status: published
                      text: Shipping day. The new editor is live for everyone.
                      media:
                        - url: https://cdn.example.com/launch.jpg
                          type: image
                          mime_type: image/jpeg
                          size_bytes: 284119
                          alt: The new editor, open on a draft post
                          thumbnail_url: null
                      link: null
                      post_type: post
                      title: null
                      thread: null
                      auto_thread: true
                      networks: {}
                      scheduled_at: null
                      published_at: '2026-09-10T11:04:12.881Z'
                      source: api
                      idempotency_key: null
                      created_at: '2026-09-10T11:03:44.102Z'
                      updated_at: '2026-09-10T11:04:12.902Z'
                      targets:
                        - id: cly7q9v2m0002x8b3b5e6f0ee
                          profile_id: cly7p2q4k0001x8b3f2n9d0aa
                          network: instagram
                          profile_name: Nylon Studio
                          status: published
                          post_ids:
                            - '17924418112233445'
                          url: https://www.instagram.com/p/C8xYzAbCdEf/
                          attempts: 1
                          published_at: '2026-09-10T11:04:09.418Z'
                          error: null
        '400':
          description: |
            The body is invalid, or the post breaks a limit on at least one
            addressed network. `details` names the network and the rule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                perNetwork:
                  value:
                    error:
                      code: invalid_request
                      message: This post is not valid for every profile you addressed.
                      details:
                        - network: instagram
                          code: invalid_request
                          message: >-
                            Instagram requires at least 1 media item — text-only
                            posts are not supported.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '404':
          description: One of the `profile_ids` is not a profile on this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: The post was rejected by a network at publish time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreatePostRequest:
      type: object
      required:
        - profile_ids
      properties:
        profile_ids:
          type: array
          minItems: 1
          description: >-
            The connected profiles to publish to. Every one is validated before
            anything sends.
          items:
            type: string
          example:
            - cly7p2q4k0001x8b3f2n9d0aa
        text:
          type: string
          maxLength: 20000
          default: ''
          description: |
            The caption. On the four threading networks this may exceed one
            post's limit — see `auto_thread`.
        media:
          type: array
          maxItems: 35
          default: []
          items:
            $ref: '#/components/schemas/MediaInput'
        link:
          description: A link to attach, on the networks that render one.
          oneOf:
            - $ref: '#/components/schemas/LinkInput'
            - type: 'null'
        post_type:
          type: string
          enum:
            - post
            - reel
            - story
          default: post
        title:
          type:
            - string
            - 'null'
          maxLength: 300
          description: Required by YouTube; used by Pinterest and TikTok photo posts.
        thread:
          type:
            - array
            - 'null'
          maxItems: 50
          items:
            type: string
          description: |
            Explicit thread parts. When set they are published verbatim rather
            than derived from `text` — someone who wrote the breaks gets the
            breaks they wrote.
        auto_thread:
          type: boolean
          default: true
          description: |
            Split an over-long caption into a thread rather than rejecting it.
            Only meaningful on X, Threads, Bluesky and Mastodon.
        scheduled_at:
          type:
            - string
            - 'null'
          format: date-time
          description: |
            When to publish. A time in the past is treated as now rather than
            refused, and so is a time less than a minute out — "in forty
            seconds" means now. Anything further out is held by a durable run
            that wakes at that time. The response says which happened:
            `status: "scheduled"` with the time, or an already-published post.
        publish_now:
          type: boolean
          description: Publish immediately, ignoring `scheduled_at`.
        idempotency_key:
          type:
            - string
            - 'null'
          minLength: 8
          maxLength: 255
          description: |
            Replaying a request with a key that was already used returns the
            original post untouched, with `Idempotent-Replay: true`.
        networks:
          type: object
          description: >-
            Per-network overrides, keyed by network. An unknown key is rejected
            by name.
          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
  headers:
    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
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        example: 47
  responses:
    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.
    PaymentRequired:
      description: |
        Billing is blocking the action. Most often an addressed profile is
        beyond the free allowance while the subscription is inactive — it is
        still connected and still listed with `suspended: true`, but nothing
        can be published through it until billing restarts.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            suspended:
              value:
                error:
                  code: payment_required
                  message: >-
                    Nylon Studio is beyond your free allowance and your
                    subscription is not active. Restart billing to publish
                    through them again.
    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'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Nylon API key
      description: An API key beginning with `nylon_live_`.

````