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

# Create a new post



## OpenAPI

````yaml /api-reference/openapi.json post /posts
openapi: 3.1.0
info:
  title: Autoposting API
  description: >-
    Schedule, publish, and AI-enhance social content across X, LinkedIn,
    Instagram, Threads, and YouTube. All responses use the `{ "success":
    boolean, "data": ... }` envelope. Authenticate with an API key
    (`Authorization: Bearer sk-social-...` or `x-api-key: sk-social-...`).
  version: 1.0.0
servers:
  - url: https://app.autoposting.ai/api-proxy
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Agents
    description: >-
      Create and manage AI agents that autonomously generate and schedule
      content, trigger runs, inspect outputs, and track statistics.
  - name: API Keys
    description: >-
      Create, list, update, and revoke API keys for programmatic access to the
      Autoposting.ai API.
  - name: Auth
    description: >-
      Signup, login, logout, social login, profile management, email change, and
      session management.
  - name: Billing
    description: >-
      Manage subscriptions, credits, plan changes, billing history, and the
      customer portal.
  - name: Brands
    description: >-
      Create, list, update, delete, and reorder brands. Each brand maps to a set
      of social media accounts.
  - name: Carousels
    description: >-
      Create, manage, and AI-generate carousel posts for LinkedIn and other
      platforms.
  - name: Clips
    description: >-
      Upload, manage, render, and publish video clips, including multipart
      upload, AI candidate generation, and credit billing.
  - name: Knowledge Base
    description: >-
      Knowledge bases, document ingestion, semantic search, and AI content idea
      generation.
  - name: Notifications
    description: List, read, and manage in-app notifications and notification preferences.
  - name: Organizations
    description: >-
      Create, list, update, and delete organizations (workspaces), including a
      safeguarded deletion flow with a grace period.
  - name: Platform OAuth
    description: >-
      Connect social media accounts via OAuth and manage platform tokens for X,
      LinkedIn, Instagram, Threads, and YouTube.
  - name: Posts
    description: Create, manage, schedule, publish, and AI-enhance posts across platforms.
  - name: Teams
    description: >-
      Manage team members, invitations, invite links, permission groups,
      brand-level overrides, ownership transfers, and allowed email domains.
  - name: Usage
    description: >-
      Usage summaries, token breakdowns, feature access, onboarding progress,
      and account management endpoints.
  - name: Webhooks
    description: >-
      Configure outbound webhook endpoints to receive real-time event
      notifications from Autoposting.ai.
paths:
  /posts:
    post:
      tags:
        - Posts
      summary: Create a new post
      operationId: createPost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - brandSlug
                - text
                - platforms
              properties:
                brandSlug:
                  type: string
                  description: Slug of the brand to post from.
                  example: acme-corp
                text:
                  type: string
                  description: Post content text.
                  example: Exciting news from Acme! 🚀
                platforms:
                  type: array
                  description: Target platforms.
                  items:
                    type: string
                    enum:
                      - x
                      - linkedin
                      - instagram
                      - threads
                      - youtube
                  example:
                    - x
                    - linkedin
                scheduledAt:
                  type: string
                  format: date-time
                  description: >-
                    ISO 8601 datetime to schedule the post. Omit to save as
                    draft.
                  example: '2025-02-01T10:00:00Z'
                media:
                  type: array
                  description: Media attachments.
                  items:
                    $ref: '#/components/schemas/MediaObject'
                thread:
                  type: array
                  description: >-
                    Additional tweet content for X threads. Each element is a
                    subsequent tweet in the thread.
                  items:
                    type: string
                source:
                  type: string
                  description: >-
                    Origin source of the post (e.g., `dashboard`, `api`,
                    `agent`).
                targetAccountIds:
                  $ref: '#/components/schemas/TargetAccountIds'
                instagramOptions:
                  $ref: '#/components/schemas/InstagramOptions'
                threadsOptions:
                  $ref: '#/components/schemas/ThreadsOptions'
                youtubeOptions:
                  $ref: '#/components/schemas/YoutubeOptions'
            example:
              brandSlug: acme-corp
              text: Exciting news from Acme! 🚀
              platforms:
                - x
                - linkedin
              scheduledAt: '2025-02-01T10:00:00Z'
      responses:
        '200':
          description: Post created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    $ref: '#/components/schemas/Post'
              example:
                success: true
                data:
                  id: post_01HXYZ
                  brandSlug: acme-corp
                  text: Exciting news from Acme! 🚀
                  platforms:
                    - x
                    - linkedin
                  status: scheduled
                  scheduledAt: '2025-02-01T10:00:00Z'
                  media: []
                  createdAt: '2024-01-01T00:00:00Z'
                  updatedAt: '2024-01-01T00:00:00Z'
        '401':
          description: Unauthorized — missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: false
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - error
                  - message
              example:
                success: false
                error: unauthorized
                message: Missing or invalid API key.
components:
  schemas:
    MediaObject:
      type: object
      required:
        - url
        - type
      properties:
        url:
          type: string
          description: URL of the media file.
        type:
          type: string
          enum:
            - image
            - video
          description: Media type.
        altText:
          type: string
          description: Alt text for the media (used for accessibility and LinkedIn).
    TargetAccountIds:
      type: object
      description: >-
        Map of platform to array of specific account IDs to post from. If
        omitted, all connected accounts for the brand are used.
      additionalProperties:
        type: array
        items:
          type: string
      example:
        x:
          - account-id-1
        linkedin:
          - account-id-2
    InstagramOptions:
      type: object
      properties:
        reel:
          type: object
          properties:
            thumbOffsetMs:
              type: number
              description: Thumbnail offset in milliseconds.
            shareToFeed:
              type: boolean
              default: true
              description: Whether to share the reel to the feed.
            coverUrl:
              type: string
              description: Custom cover image URL.
            collaborators:
              type: array
              items:
                type: string
              description: Instagram usernames to tag as collaborators.
    ThreadsOptions:
      type: object
      properties:
        replyToId:
          type: string
          description: Threads post ID to reply to.
        replyControl:
          type: string
          enum:
            - everyone
            - accounts_you_follow
            - mentioned_only
          description: Who can reply.
    YoutubeOptions:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          description: Video title.
        description:
          type: string
          description: Video description.
        tags:
          type: array
          items:
            type: string
          description: Video tags.
        privacyStatus:
          type: string
          enum:
            - public
            - private
            - unlisted
          default: public
        madeForKids:
          type: boolean
          default: false
          description: Whether the video is made for kids.
    Post:
      type: object
      required:
        - id
        - brandSlug
        - text
        - platforms
        - status
      properties:
        id:
          type: string
          example: post_01HXYZ
        brandSlug:
          type: string
        text:
          type: string
        platforms:
          type: array
          items:
            type: string
            enum:
              - x
              - linkedin
              - instagram
              - threads
              - youtube
        status:
          $ref: '#/components/schemas/PostStatus'
        scheduledAt:
          type: string
          format: date-time
        media:
          type: array
          items:
            $ref: '#/components/schemas/MediaObject'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PostStatus:
      type: string
      description: Lifecycle status of a post.
      enum:
        - draft
        - scheduled
        - validating
        - validated
        - publishing
        - published
        - partial
        - failed
        - archived
        - render_pending
        - billing_hold
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key as `Authorization: Bearer sk-social-...`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API key as `x-api-key: sk-social-...`'

````