A schema ID is the unique numeric identifier Schema Registry assigns when a schema is registered. Registration stores schemas under a subject and version, while the returned ID identifies the registered schema for later lookup. section 3.2.5
Use a schema ID when an application must select an exact registered schema rather than accepting the latest version. This is especially important for topics shared by multiple applications: matching schemas avoids data-formatting errors and lets supported clients infer fields and types from the schema. section 11.2
Work with schema IDs in a practical flow:
- Register a schema by posting it to a subject’s versions endpoint; Schema Registry responds with an id. section 3.2.5
- Inspect a subject’s versions or retrieve a particular version when checking what was registered. section 3.2.5
- Set value_schema_id in a ksqlDB stream definition to use that exact Avro value schema. section 11.2
- Omit the ID only when using the latest schema version is appropriate; ksqlDB otherwise assumes a topic-name key or value subject. section 11.2
Pin an Avro stream to schema ID 1
CREATE STREAM user_activity WITH (kafka_topic = 'user_activity', value_format = AVRO, value_schema_id = 1); This tells ksqlDB to retrieve the precise registered value-schema version, without separately declaring columns. section 11.2
Listing 3.6 Expected response from uploading a schema
{
"id": 1
}
The registration response shows the numeric ID returned after a schema is uploaded. section 3.2.5

