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

# Update Topic

> Updates a topic's name and/or description. Only the supplied fields change. Renaming to a name already used by another active topic on the website returns `400`. Renames don't affect metrics or prompt grouping — everything joins on the topic's `id`, not its name. Returns a before/after snapshot.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/topics/{topic_id}
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.
paths:
  /api/v1/topics/{topic_id}:
    patch:
      tags:
        - Basics
      summary: Update Topic
      description: >-
        Updates a topic's name and/or description. Only the supplied fields
        change. Renaming to a name already used by another active topic on the
        website returns `400`. Renames don't affect metrics or prompt grouping —
        everything joins on the topic's `id`, not its name. Returns a
        before/after snapshot.
      operationId: updateTopic
      parameters:
        - name: topic_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The topic to update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - website_id
              properties:
                website_id:
                  type: string
                  format: uuid
                  description: Website that owns the topic.
                name:
                  type: string
                  maxLength: 255
                  description: New topic name. Trimmed; blank rejected.
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 2000
                  description: New topic description. Send null to clear.
      responses:
        '200':
          description: Topic updated
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - name
                  - description
                  - before
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  description:
                    type:
                      - string
                      - 'null'
                  before:
                    type: object
                    description: Pre-update snapshot.
                    required:
                      - name
                      - description
                    properties:
                      name:
                        type: string
                      description:
                        type:
                          - string
                          - 'null'
        '400':
          description: Bad request - Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                duplicate_name:
                  value:
                    error: >-
                      A topic named "Brand awareness" already exists on this
                      website
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - You don't have access to this website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found - Topic not found, deleted, or on another website
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                not_found:
                  value:
                    error: Topic not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      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).

````