# rpk registry schema create

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: rpk registry schema create
latest-redpanda-tag: v25.3.11
latest-console-tag: v3.7.3
latest-operator-version: v26.1.4
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: November 19, 2026
latest-connect-version: 4.93.0
docname: rpk/rpk-registry/rpk-registry-schema-create
page-component-name: streaming
page-version: "25.3"
page-component-version: "25.3"
page-component-title: Streaming
page-relative-src-path: rpk/rpk-registry/rpk-registry-schema-create.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/v/25.3/modules/reference/pages/rpk/rpk-registry/rpk-registry-schema-create.adoc
page-git-created-date: "2023-12-22"
page-git-modified-date: "2025-11-19"
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/25.3/reference/rpk/rpk-registry/rpk-registry-schema-create.md -->

Create a schema for the given subject.

This uploads a schema to the registry, creating the schema if it does not exist. The schema type is detected by the filename extension: `.avro` or `.avsc` for Avro, `json` for JSON, and `.proto` for Protobuf. You can manually specify the type with the `--type` flag.

You may pass the references using the --reference flag, which accepts either a comma separated list of `<name>:<subject>:<version>` or a path to a file. The file must contain lines of name, subject, and version separated by a tab or space, or the equivalent in json / yaml format.

## [](#examples)Examples

Create a Protobuf schema with subject `foo`:

```bash
rpk registry schema create foo --schema path/to/file.proto
```

Create an avro schema, passing the type via flags:

```bash
rpk registry schema create foo --schema /path/to/file --type avro
```

Create a Protobuf schema that references the schema in subject `my_subject`, version 1:

```bash
rpk registry schema create foo --schema /path/to/file.proto --references my_name:my_subject:1
```

Create a schema with a specific ID and version in import mode:

```bash
rpk registry schema create foo --schema /path/to/file.proto --id 42 --schema-version 3
```

## [](#usage)Usage

```bash
rpk registry schema create SUBJECT --schema {filename} [flags]
```

## [](#flags)Flags

| Value | Type | Description |
| --- | --- | --- |
| -h, --help | - | Help for create. |
| --id | int | Optional schema ID to use when creating the schema in import mode (default -1). |
| --references | string | Comma-separated list of references (name:subject:version) or path to reference file. |
| --schema | string | Schema filepath to upload, must be .avro, .avsc, or .proto. |
| --schema-version | int | Optional schema version to use when creating the schema in import mode (requires --id and the default is -1). |
| --type | string | Schema type avro or protobuf ; overrides schema file extension. |
| --config | string | Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD, and /etc/redpanda/redpanda.yaml. |
| -X, --config-opt | stringArray | Override rpk configuration settings. See rpk -X or execute rpk -X help for inline detail or rpk -X list for terser detail. |
| --format | string | Output format: json,yaml,text,wide,help. Default: text. |
| --profile | string | Profile to use. See rpk profile for more details. |
| -v, --verbose | - | Enable verbose logging. |