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

# Merge Pillars

> Merges 1-20 source pillars into a published target pillar: every fact on the sources (any review status) re-files onto the target, page links carry over keeping the stronger signal, and the source pillars are then deleted. The target must be a published pillar and must not appear among the sources. Unlike the other Knowledge Base writes, retries are strict: missing source ids are rejected rather than skipped, so re-read the pillars before retrying a failed merge. Requires a website-admin API key. Also available as the MCP tool `merge_pillars`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/knowledge-base/pillars/merge
openapi: 3.1.0
info:
  title: AthenaHQ API
  description: >-
    AthenaHQ API provides programmatic access to manage your websites and
    prompts for AI-powered content optimization.
  version: 1.0.0
  contact:
    email: support@athenahq.ai
servers:
  - url: https://api.athenahq.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Basics
    description: Core API operations for managing websites and prompts
  - name: Metrics
    description: Metrics and analytics endpoints for tracking AI visibility
  - name: Billing
    description: Billing and credits endpoints for managing usage
  - name: Team Management
    description: Endpoints for managing team members and invitations
  - name: Groups
    description: Endpoints for managing groups of websites
  - name: Content
    description: >-
      Endpoints for accessing Content Hub data — tabs, tracked URLs, and per-URL
      prompt breakdowns.
  - name: Pitch Workspace
    description: >-
      Endpoints for accessing pitch workspace reports — org-scoped pitch runs
      with competitors, prompts, attributes, and aggregate metrics.
  - name: Knowledge Base
    description: >-
      Endpoints for reading the brand Knowledge Base — approved brand facts and
      the pillars that organize them.
paths:
  /api/v1/knowledge-base/pillars/merge:
    post:
      tags:
        - Knowledge Base
      summary: Merge Pillars
      description: >-
        Merges 1-20 source pillars into a published target pillar: every fact on
        the sources (any review status) re-files onto the target, page links
        carry over keeping the stronger signal, and the source pillars are then
        deleted. The target must be a published pillar and must not appear among
        the sources. Unlike the other Knowledge Base writes, retries are strict:
        missing source ids are rejected rather than skipped, so re-read the
        pillars before retrying a failed merge. Requires a website-admin API
        key. Also available as the MCP tool `merge_pillars`.
      operationId: mergePillars
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                website_id:
                  type: string
                  format: uuid
                  description: The website whose pillars to merge.
                target_pillar_id:
                  type: string
                  format: uuid
                  description: >-
                    The published pillar that survives and receives the sources'
                    facts.
                source_pillar_ids:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: string
                    format: uuid
                  description: Pillars to fold into the target. Deleted after the merge.
              required:
                - website_id
                - target_pillar_id
                - source_pillar_ids
      responses:
        '200':
          description: Merge report
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  moved_fact_count:
                    type: integer
                    description: Facts re-filed from the sources onto the target.
                  merged_pillars:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                    description: >-
                      The deleted source pillars, in request order. A deleted
                      pillar cannot be re-fetched, so this is the caller's
                      record.
                  pillar:
                    type: object
                    description: The surviving target pillar.
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                    required:
                      - id
                      - name
                required:
                  - success
                  - moved_fact_count
                  - merged_pillars
                  - pillar
        '400':
          description: >-
            Bad request - Invalid parameters, no source other than the target,
            or the target pillar is not published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unpublished_target:
                  value:
                    error: pillars can only be merged into a published pillar
                source_is_target:
                  value:
                    error: source_pillar_ids must not include the target
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden - No admin access to this website, or the Knowledge Base
            is not enabled for the organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized_website:
                  value:
                    error: Unauthorized access to this website
                kb_not_enabled:
                  value:
                    error: Knowledge Base is not enabled for this organization
        '404':
          description: >-
            Not found - The target or one of the sources does not exist on the
            website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                target_not_found:
                  value:
                    error: Target pillar not found
                sources_not_found:
                  value:
                    error: One or more source pillars were not found
      security:
        - apiKey: []
components:
  schemas:
    Error:
      type: object
      description: Error response object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: Unauthorized
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. You can create one
        [here](https://app.athenahq.ai/organization?tab=api).

````