# REST Resource: projects.schemas

- [Resource: Schema](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Schema)
  - [JSON representation](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Schema.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Type)
- [Methods](https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#METHODS_SUMMARY)

## Resource: Schema

A schema resource.

| JSON representation |
|---|
| ``` { "name": string, "type": enum (`https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Type`), "definition": string, "revisionId": string, "revisionCreateTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. Name of the schema. Format is `projects/{project}/schemas/{schema}`. |
| `type` | ``enum (`https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas#Type`)`` The type of the schema definition. |
| `definition` | `string` The definition of the schema. This should contain a string representing the full definition of the schema that is a valid schema definition of the type specified in `type`. |
| `revisionId` | `string` Output only. Immutable. The revision ID of the schema. |
| `revisionCreateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The timestamp that the revision was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## Type

Possible schema definition types.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Default value. This value is unused. |
| `PROTOCOL_BUFFER` | A Protocol Buffer schema definition. |
| `AVRO` | An Avro schema definition. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/commit` | Commits a new schema revision to an existing schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/create` | Creates a schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/delete` | Deletes a schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/deleteRevision` | Deletes a specific schema revision. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/get` | Gets a schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/list` | Lists schemas in a project. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/listRevisions` | Lists all schema revisions for the named schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/rollback` | Creates a new schema revision that is a copy of the provided revision_id. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/validate` | Validates a schema. |
| ### `https://docs.cloud.google.com/pubsub/docs/reference/rest/v1/projects.schemas/validateMessage` | Validates a message against a schema. |