<!-- WARNING: This documentation is auto-generated from the confluentinc/cli repository and should not be manually edited. -->

<a id="confluent-kafka-topic-update"></a>

# confluent kafka topic update

## Description

Update a Kafka topic.

```none
confluent kafka topic update <topic> [flags]
```

## Flags

### Cloud

```none
    --config strings          REQUIRED: A comma-separated list of "key=value" pairs, or path to a configuration file containing a newline-separated list of "key=value" pairs.
    --kafka-endpoint string   Endpoint to be used for this Kafka cluster.
    --dry-run                 Run the command without committing changes.
    --cluster string          Kafka cluster ID.
    --context string          CLI context name.
    --environment string      Environment ID.
-o, --output string           Specify the output format as "human", "json", or "yaml". (default "human")
```

### On-Premises

```none
    --url string                          Base URL of REST Proxy Endpoint of Kafka Cluster (include "/kafka" for embedded Rest Proxy). Must set flag or CONFLUENT_REST_URL.
    --certificate-authority-path string   Path to a PEM-encoded Certificate Authority to verify the Confluent REST Proxy.
    --client-cert-path string             Path to client cert to be verified by Confluent REST Proxy. Include for mTLS authentication.
    --client-key-path string              Path to client private key, include for mTLS authentication.
    --no-authentication                   Include if requests should be made without authentication headers and user will not be prompted for credentials.
    --prompt                              Bypass use of available login credentials and prompt for Kafka Rest credentials.
    --config strings                      A comma-separated list of "key=value" pairs, or path to a configuration file containing a newline-separated list of "key=value" pairs.
-o, --output string                       Specify the output format as "human", "json", or "yaml". (default "human")
```

## Global Flags

```none
-h, --help            Show help for this command.
    --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).
```

## Examples

### Cloud

Modify the “my_topic” topic to have a retention period of 3 days (259200000 milliseconds).

```none
confluent kafka topic update my_topic --config retention.ms=259200000
```

### On-Premises

Modify the “my_topic” topic for the specified cluster (providing embedded Kafka REST Proxy endpoint) to have a retention period of 3 days (259200000 milliseconds).

```none
confluent kafka topic update my_topic --url http://localhost:8082 --config retention.ms=259200000
```

Modify the “my_topic” topic for the specified cluster (providing Kafka REST Proxy endpoint) to have a retention period of 3 days (259200000 milliseconds).

```none
confluent kafka topic update my_topic --url http://localhost:8082 --config retention.ms=259200000
```

## See Also

* [confluent kafka topic](index.md#confluent-kafka-topic) - Manage Kafka topics.
