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

<a id="confluent-schema-registry-schema-delete"></a>

# confluent schema-registry schema delete

## Description

Delete one or more schema versions. This command should only be used if absolutely necessary.

```none
confluent schema-registry schema delete [flags]
```

## Flags

### Cloud

```none
--subject string                    REQUIRED: Subject of the schema.
--version string                    REQUIRED: Version of the schema. Can be a specific version, "all", or "latest".
--permanent                         Permanently delete the schema. You must first soft delete the schema by deleting the schema without this flag.
--context string                    CLI context name.
--environment string                Environment ID.
--schema-registry-endpoint string   The URL of the Schema Registry cluster.
--force                             Skip the deletion confirmation prompt.
```

### On-Premises

```none
--subject string                      REQUIRED: Subject of the schema.
--version string                      REQUIRED: Version of the schema. Can be a specific version, "all", or "latest".
--permanent                           Permanently delete the schema. You must first soft delete the schema by deleting the schema without this flag.
--context string                      CLI context name.
--certificate-authority-path string   File or directory path to Certificate Authority certificates to authenticate the Schema Registry client.
--client-cert-path string             File or directory path to client certificate to authenticate the Schema Registry client.
--client-key-path string              File or directory path to client key to authenticate the Schema Registry client.
--schema-registry-endpoint string     The URL of the Schema Registry cluster.
--force                               Skip the deletion confirmation prompt.
```

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

Soft delete the latest version of subject “payments”.

```none
confluent schema-registry schema delete --subject payments --version latest
```

Soft delete version “2” of subject “payments”.

```none
confluent schema-registry schema delete --subject payments --version 2
```

Permanently delete version “2” of subject “payments”, which must be soft deleted first.

```none
confluent schema-registry schema delete --subject payments --version 2 --permanent
```

### On-Premises

Soft delete the latest version of subject “payments”.

```none
confluent schema-registry schema delete --subject payments --version latest --certificate-authority-path <certification-authority-location> --schema-registry-endpoint <schema-registry-endpoint>
```

Soft delete version “2” of subject “payments”.

```none
confluent schema-registry schema delete --subject payments --version 2 --certificate-authority-path <certification-authority-location> --schema-registry-endpoint <schema-registry-endpoint>
```

Permanently delete version “2” of subject “payments”, which must be soft deleted first.

```none
confluent schema-registry schema delete --subject payments --version 2 --permanent --certificate-authority-path <certification-authority-location> --schema-registry-endpoint <schema-registry-endpoint>
```

## See Also

* [confluent schema-registry schema](index.md#confluent-schema-registry-schema) - Manage Schema Registry schemas.
