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

# Delete a topic

> Deletes a topic and its messages. Requires an account token. An immutable topic cannot be
deleted while it holds locked messages.




## OpenAPI

````yaml /api-reference/openapi.yaml delete /v1/topics/{topic}
openapi: 3.1.0
info:
  title: Link4Sync Public API
  version: 1.0.0
  summary: Manage your topics from code.
  description: >
    The Link4Sync Public API lets your services list, create, and delete topics.


    Messages do not go through this API. Publish to a topic's HTTPS, HTTP, or
    MQTT connection,

    and read by subscribing to `<topic ID>/out` over MQTT.


    Every request needs a Keycloak access token in the `Authorization: Bearer
    <token>` header.

    Two kinds of token are accepted:


    - **Account token**: issued by the `kafka-connect-access` client for your
    Link4Sync login.
      It can manage every topic of your account.
    - **Subaccount token**: issued with client credentials for an OAuth
    subaccount. It can list
      the topics of that subaccount.
  contact:
    email: support@link4sync.com
servers:
  - url: https://api.link4sync.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Topics
    description: List, create, and delete topics.
paths:
  /v1/topics/{topic}:
    parameters:
      - $ref: '#/components/parameters/TopicPath'
    delete:
      tags:
        - Topics
      summary: Delete a topic
      description: >
        Deletes a topic and its messages. Requires an account token. An
        immutable topic cannot be

        deleted while it holds locked messages.
      operationId: deleteTopic
      responses:
        '204':
          description: The topic was deleted.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    TopicPath:
      name: topic
      in: path
      required: true
      description: The topic name, as shown in the dashboard.
      schema:
        $ref: '#/components/schemas/TopicName'
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The access token is missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        This token may not do this, or the account must first accept the current
        terms.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The topic does not exist or is not available to this token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: The request conflicts with the topic's current state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Too many requests. Wait the number of seconds in `Retry-After`.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadGateway:
      description: The platform could not complete the request. Retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: The service is temporarily unavailable. Retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    TopicName:
      type: string
      description: >-
        Lowercase letters, digits, and hyphens; starts and ends with a letter or
        digit.
      minLength: 1
      maxLength: 201
      pattern: ^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$
      examples:
        - orders
    Error:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
          description: A short description of the problem.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A Keycloak access token: an account token from the
        `kafka-connect-access` client, or a

        subaccount token from client credentials. Tokens are short-lived;
        request a new one when

        you get `401`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.