v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Databases

Create Schema Registry for Kafka Cluster

To create a Kafka schema for a database cluster, send a POST request to /v2/databases/$DATABASE_ID/schema-registry.

post/v2/databases/{database_cluster_uuid}/schema-registry

Path parameters

database_cluster_uuidstring uuid required

A unique identifier for a database cluster.

Request body

subject_namestring

The name of the schema subject.

schema_type'AVRO' | 'JSON' | 'PROTOBUF'

The type of the schema.

schemastring

The schema definition in the specified format.

Example request

{
  "subject_name": "customer-schema",
  "schema_type": "AVRO",
  "schema": "{\n  \"type\": \"record\",\n  \"name\": \"Customer\",\n  \"fields\": [\n    {\"name\": \"id\", \"type\": \"int\"},\n    {\"name\": \"name\", \"type\": \"string\"}\n  ]\n}"
}

Response

A JSON object.

schema_idinteger

The id for schema.

subject_namestring

The name of the schema subject.

schema_type'AVRO' | 'JSON' | 'PROTOBUF'

The type of the schema.

schemastring

The schema definition in the specified format.

Example response

{
  "schema_id": 12345,
  "subject_name": "customer-schema",
  "schema_type": "AVRO",
  "schema": "{\n  \"type\": \"record\",\n  \"name\": \"Customer\",\n  \"fields\": [  \n    {\"name\": \"id\", \"type\": \"int\"},\n    {\"name\": \"name\", \"type\": \"string\"}\n  ]\n} "
}