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

# Create a planned post

> Create an AI or manual post and put it on the schedule. Requires the WRITE_SOCIAL scope.

A manual post (`kind: "manual"`) publishes the app's own `media` URLs and needs only `WRITE_SOCIAL`. An AI post (`kind: "ai"`, the default) generates images from `prompt` with the store's AI credits and also needs `USE_MERCHANT_AI`. Set `requiresPromptApproval: true` to save a prompt-only draft that generates nothing until approved.


## OpenAPI

````yaml apps-api/specs/social.json POST /social-posts
openapi: 3.1.0
info:
  title: 'Salesive Apps API: Post Planner'
  version: 1.0.0
  description: >-
    Plan, schedule and publish Instagram, TikTok and LinkedIn posts from an
    installed third-party app, and read the store's connected accounts. Reads
    need `READ_SOCIAL`; writes need `WRITE_SOCIAL`; generating images with the
    store's AI credits additionally needs `USE_MERCHANT_AI`. Without that grant
    an app must supply its own media: generate the image itself and pass the
    URL, or add it through the file API, then create a manual post. The target
    store is bound to the token server-side from the installation, so never send
    a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
tags:
  - name: Post planner
    description: Planned posts, the asset library, presets and publishing.
  - name: Connected accounts
    description: Read-only view of the store's connected social accounts.
paths:
  /social-posts:
    post:
      tags:
        - Post planner
      summary: Create a planned post
      description: >-
        Creates a post and puts it on the generation and publishing schedule. A
        manual post (`kind: "manual"`) publishes the app's own `media` URLs and
        needs only `WRITE_SOCIAL`. An AI post (`kind: "ai"`, the default)
        generates its images from `prompt` with the store's AI credits and also
        needs `USE_MERCHANT_AI`; with `requiresPromptApproval: true` it is saved
        as a `proposed` draft that generates nothing until approved.
      operationId: createSocialPost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePostRequest'
            example:
              kind: manual
              platforms:
                - instagram
              scheduledAt: '2026-12-01T09:00:00.000Z'
              media:
                - url: https://cdn.example.com/post.jpg
                  type: image
              caption: Fresh from the kitchen
      responses:
        '201':
          description: The created post.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/SocialPost'
        '403':
          description: >-
            The app is missing `WRITE_SOCIAL`, or an AI post was requested
            without `USE_MERCHANT_AI`.
components:
  schemas:
    CreatePostRequest:
      type: object
      required:
        - platforms
        - scheduledAt
      properties:
        kind:
          type: string
          enum:
            - ai
            - manual
          default: ai
          description: >-
            Defaults to `ai`. An AI post needs `USE_MERCHANT_AI` unless
            `requiresPromptApproval` is true; a manual post needs `media`.
        title:
          type: string
          maxLength: 120
        prompt:
          type: string
          minLength: 3
          maxLength: 2500
          description: Required for an AI post.
        caption:
          type: string
          maxLength: 2200
        captions:
          type: object
          properties:
            instagram:
              type: string
            tiktok:
              type: string
            linkedin:
              type: string
        platforms:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            type: string
            enum:
              - instagram
              - tiktok
              - linkedin
        formats:
          type: array
          uniqueItems: true
          items:
            type: string
          description: Placements. Derived from `platforms` when omitted.
        media:
          type: array
          maxItems: 35
          items:
            $ref: '#/components/schemas/MediaItem'
          description: Manual posts only. The app's own hosted files.
        slides:
          type: array
          items:
            type: object
            properties:
              prompt:
                type:
                  - string
                  - 'null'
        references:
          type: array
          maxItems: 4
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              name:
                type:
                  - string
                  - 'null'
              source:
                type: string
                enum:
                  - library
                  - catalog
                  - upload
                  - generated
        colors:
          type: array
          items:
            type: string
        scheduledAt:
          type: string
          format: date-time
        generateAheadHours:
          type: integer
          minimum: 0
          maximum: 168
          default: 24
        mode:
          type: string
          enum:
            - auto
            - approval
          description: Manual posts default to `auto`; AI posts default to `approval`.
        premium:
          type: boolean
          default: false
        requiresPromptApproval:
          type: boolean
          default: false
          description: >-
            Create a prompt-only draft. It generates nothing until
            approve-prompt is called, so it needs no AI grant.
        taggedAccounts:
          type: array
          items:
            type: object
            properties:
              username:
                type: string
              x:
                type: number
              'y':
                type: number
        collaborators:
          type: array
          maxItems: 3
          items:
            type: string
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
        success:
          type: boolean
        message:
          type: string
    SocialPost:
      type: object
      description: >-
        A planned post. `kind: "ai"` generates its images from `prompt`; `kind:
        "manual"` publishes the files in `media`.
      properties:
        _id:
          type: string
        kind:
          type: string
          enum:
            - ai
            - manual
        title:
          type:
            - string
            - 'null'
        prompt:
          type: string
          description: The generation prompt. Required for an AI post.
        caption:
          type: string
        captions:
          type: object
          additionalProperties:
            type:
              - string
              - 'null'
        platforms:
          type: array
          items:
            type: string
            enum:
              - instagram
              - tiktok
              - linkedin
        formats:
          type: array
          description: Placements, such as ig_feed, ig_story, tiktok_photo, li_feed.
          items:
            type: string
        media:
          type: array
          items:
            $ref: '#/components/schemas/MediaItem'
        scheduledAt:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - proposed
            - scheduled
            - generating
            - awaiting_approval
            - ready
            - publishing
            - posted
            - failed
            - skipped
        mode:
          type: string
          enum:
            - auto
            - approval
        generated:
          type: object
          properties:
            images:
              type: array
              items:
                type: string
            imagesByFormat:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
            generatedAt:
              type:
                - string
                - 'null'
              format: date-time
        publishResults:
          type: array
          items:
            type: object
            properties:
              platform:
                type: string
              format:
                type: string
              success:
                type: boolean
              postId:
                type:
                  - string
                  - 'null'
              error:
                type:
                  - string
                  - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    MediaItem:
      type: object
      required:
        - url
        - type
      properties:
        url:
          type: string
          format: uri
        type:
          type: string
          enum:
            - image
            - video
        duration:
          type: number
          description: Video length in seconds, when known.
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side, so never send a shop
        id.

````

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