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

# Change Kafka topic retention

> Sets a topic's `retention.ms`. Potentially destructive: Kafka deletes messages older than the new retention, and on Artie-managed topics that can drop change events before Artie pipelines read them.



## OpenAPI

````yaml https://raw.githubusercontent.com/artie-labs/artie-api-spec/refs/heads/master/openapi.yaml post /kafka-clusters/{uuid}/topics/{topic}/retention
openapi: 3.1.0
info:
  description: External API endpoints for Artie
  title: Artie API
  version: v1.0.130
servers:
  - url: https://api.artie.com
security:
  - ApiKey: []
paths:
  /kafka-clusters/{uuid}/topics/{topic}/retention:
    post:
      tags:
        - Kafka Clusters
      summary: Change Kafka topic retention
      description: >-
        Sets a topic's `retention.ms`. Potentially destructive: Kafka deletes
        messages older than the new retention, and on Artie-managed topics that
        can drop change events before Artie pipelines read them.
      operationId: kafka_topic_retention_update
      parameters:
        - in: path
          name: topic
          required: true
          schema:
            type: string
        - in: path
          name: uuid
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouterUpdateKafkaTopicRetentionRequest'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
        '502':
          description: Bad Gateway
components:
  schemas:
    RouterUpdateKafkaTopicRetentionRequest:
      properties:
        retentionMS:
          description: >-
            New retention.ms: at least 86400000 (one day), or -1 to keep
            messages forever.
          type: integer
      required:
        - retentionMS
      type: object
  securitySchemes:
    ApiKey:
      description: API key passed as a Bearer token in the Authorization header.
      scheme: bearer
      type: http

````

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