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

# Publish, schedule, cancel, or direct-publish (as-is) social content



## OpenAPI

````yaml post /api/agent/publish
openapi: 3.1.0
info:
  title: Citedy Agent API
  version: 1.0.0
  description: >-
    Public contract for Citedy agent integrations. This contract reflects the
    current /api/agent surface without changing runtime behavior.
  contact:
    name: Citedy Support
    url: https://www.citedy.com
  license:
    name: Proprietary
    url: https://www.citedy.com
servers:
  - url: https://www.citedy.com
security: []
tags:
  - name: Health
    description: Platform and dependency health
  - name: Registration
    description: Agent onboarding and approval
  - name: Agent
    description: Agent identity and key lifecycle
  - name: Scout
    description: Trend scouting endpoints
  - name: Gaps
    description: Content gap analysis
  - name: Autopilot
    description: Article generation and retrieval
  - name: Articles
    description: Queued article generation job polling
  - name: Adaptations
    description: Social adaptation generation
  - name: Sessions
    description: Autopilot recurring sessions
  - name: Lead Magnets
    description: Lead magnet generation and state
  - name: Warm Leads
    description: Warm-lead report generation and export
  - name: Ingest
    description: Content ingestion jobs
  - name: Competitors
    description: Competitor discovery and analysis
  - name: Personas
    description: Writing persona catalog
  - name: Webhooks
    description: Webhook endpoint registration and delivery logs
  - name: Publishing
    description: Social publishing, scheduling and cancellation
  - name: Schedule
    description: Content schedule timeline and gap analysis
  - name: Settings
    description: Agent preferences and configuration
  - name: Scan
    description: Experimental trend scanning (xAI Grok)
  - name: Status
    description: Operational readiness and actionable onboarding status
  - name: Products
    description: Product knowledge base document management
  - name: Shorts
    description: Short-form video generation and polling
  - name: SEO Tools
    description: Agent-authenticated SEO diagnostics tools exposed via MCP seo.* namespace.
  - name: GSC
    description: Google Search Console integration and reporting
paths:
  /api/agent/publish:
    post:
      tags:
        - Publishing
      summary: Publish, schedule, cancel, or direct-publish (as-is) social content
      operationId: publishSocialAdaptation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishRequest'
      responses:
        '200':
          description: Publish action completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Platform publishing locked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Adaptation not in publishable state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - AgentApiKey: []
components:
  schemas:
    PublishRequest:
      oneOf:
        - $ref: '#/components/schemas/PublishAdaptationRequest'
        - $ref: '#/components/schemas/PublishRawRequest'
      discriminator:
        propertyName: action
        mapping:
          now:
            $ref: '#/components/schemas/PublishAdaptationRequest'
          schedule:
            $ref: '#/components/schemas/PublishAdaptationRequest'
          cancel:
            $ref: '#/components/schemas/PublishAdaptationRequest'
          publish_raw:
            $ref: '#/components/schemas/PublishRawRequest'
    PublishResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        action:
          type: string
          enum:
            - now
            - schedule
            - cancel
            - publish_raw
        adaptationId:
          type: string
          format: uuid
        postId:
          type:
            - string
            - 'null'
          description: Present when action=now
        platformPostId:
          type:
            - string
            - 'null'
          description: Present when action=publish_raw
        scheduledAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Present when action=schedule
        messageId:
          type:
            - string
            - 'null'
          description: QStash message ID for scheduled publish
        deduplicated:
          type: boolean
          description: True if publish was skipped because already published
        warning:
          type: string
          description: Present when publish_raw encounters a non-fatal issue
      required:
        - success
        - action
        - adaptationId
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
      additionalProperties: true
    PublishAdaptationRequest:
      type: object
      properties:
        adaptationId:
          type: string
          format: uuid
        action:
          type: string
          enum:
            - now
            - schedule
            - cancel
        scheduledAt:
          type: string
          format: date-time
          description: Required if action=schedule. Must be a future date.
        platform:
          type: string
          enum:
            - facebook
            - linkedin
            - x_article
            - x_thread
            - reddit
            - threads
            - instagram
            - instagram_reels
            - youtube_shorts
        accountId:
          type: string
          format: uuid
      required:
        - adaptationId
        - action
        - platform
        - accountId
      additionalProperties: false
    PublishRawRequest:
      type: object
      description: >-
        Direct publish article content as-is to a social platform. No AI
        adaptation, 0 credits.
      properties:
        action:
          type: string
          enum:
            - publish_raw
        articleId:
          type: string
          format: uuid
        platform:
          type: string
          enum:
            - linkedin
            - facebook
            - x_article
            - reddit
            - instagram
        accountId:
          type: string
          format: uuid
        subreddit:
          type: string
          description: Required when platform is reddit
      required:
        - action
        - articleId
        - platform
        - accountId
      additionalProperties: false
    RateLimitErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            retry_after:
              type: integer
          required:
            - retry_after
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    AgentApiKey:
      type: http
      scheme: bearer
      description: Bearer citedy_agent_* key

````