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

# Unpublish an article (revert to draft)

> Set article status back to 'generated'. The article remains in the system but is removed from the public blog. Only articles with status 'published' can be unpublished; attempting to unpublish an article in any other status returns 400.



## OpenAPI

````yaml patch /api/agent/articles/{id}
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/articles/{id}:
    patch:
      tags:
        - Articles
      summary: Unpublish an article (revert to draft)
      description: >-
        Set article status back to 'generated'. The article remains in the
        system but is removed from the public blog. Only articles with status
        'published' can be unpublished; attempting to unpublish an article in
        any other status returns 400.
      operationId: unpublishArticle
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Article ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - unpublish
      responses:
        '200':
          description: Article unpublished successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  article_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                      - generated
                  message:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Article is not in the required state for this operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Conflict
                  message:
                    type: string
                    example: Cannot unpublish article with status "generated"
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - AgentApiKey: []
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
      additionalProperties: true
  securitySchemes:
    AgentApiKey:
      type: http
      scheme: bearer
      description: Bearer citedy_agent_* key

````