Delete a schema subject version

This document describes how to delete a specific version of a schema subject from a schema registry. There are two ways to delete a subject version:

  • Soft-delete. Marks the version as deleted, but its information is retained and can be recovered.

  • Hard-delete. Permanently removes the version and its associated data.

Required roles and permissions

To get the permissions that you need to delete a schema subject version, ask your administrator to grant you the Managed Kafka Schema Registry Editor (roles/managedkafka.schemaRegistryEditor) IAM role on the parent subject. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the permissions required to delete a schema subject version. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to delete a schema subject version:

  • Grant the following permission on the parent subject: managedkafka.googleapis.com/subjectVersions.delete

You might also be able to get these permissions with custom roles or other predefined roles.

Soft delete a schema subject version

Here are some best practices for soft-deleting a schema subject version:

  • Verify that no active producers or consumers are using the schema subject version that you intend to delete.