openapi: 3.0.3
info:
  title: Postifys Publishing API
  version: "1.0"
  description: >
    Partial OpenAPI description of Postifys public publishing endpoints.
    Field details and edge cases remain documented at https://postifys.com/api-docs
    and https://postifys.com/docs. TikTok production delivery is creator-inbox upload.
  contact:
    name: Postifys
    email: info@postifys.com
    url: https://postifys.com/contact
servers:
  - url: https://postifys.com
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /health:
    get:
      security: []
      summary: Health check
      responses:
        "200":
          description: API process healthy
  /api/key/test:
    get:
      summary: Validate API key
      responses:
        "200":
          description: Key accepted
  /api/connections:
    get:
      summary: List connected accounts
      responses:
        "200":
          description: Connected destinations for the API key owner
  /api/facebook/post:
    post:
      summary: Publish to a Facebook Page
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text: { type: string }
                message: { type: string }
                mediaUrls:
                  oneOf:
                    - type: string
                    - type: array
                      items: { type: string }
                type: { type: string, enum: [IMAGE, REEL, FEED] }
                pageId: { type: string }
                proxyDownload: { type: boolean }
      responses:
        "200":
          description: Publish attempt recorded
  /api/instagram/post:
    post:
      summary: Publish to Instagram professional account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [mediaUrls]
              properties:
                type: { type: string, enum: [IMAGE, VIDEO, REEL] }
                mediaUrls: {}
                text: { type: string }
                caption: { type: string }
                instagramAccountId: { type: string }
                proxyDownload: { type: boolean }
      responses:
        "200":
          description: Publish attempt recorded
  /api/youtube/post:
    post:
      summary: Upload a YouTube video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [title, videoUrl]
              properties:
                title: { type: string }
                description: { type: string }
                videoUrl: { type: string }
                channelId: { type: string }
                privacyStatus: { type: string, enum: [private, unlisted, public] }
      responses:
        "200":
          description: Upload submitted
  /api/pinterest/post:
    post:
      summary: Create a Pinterest Pin
      responses:
        "200":
          description: Pin attempt recorded
  /api/linkedin/post:
    post:
      summary: Publish to LinkedIn member profile
      responses:
        "200":
          description: Publish attempt recorded
  /api/tiktok/post:
    post:
      summary: Upload video to TikTok creator inbox
      description: Creator completes publishing in TikTok. Direct Post not claimed.
      responses:
        "200":
          description: Inbox upload attempted
  /api/media/queue:
    post:
      summary: Queue remote media download
      responses:
        "202":
          description: Media job accepted
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
