---
title: "POST /v1/{+parent}/schemas:validateMessage"
method: POST
path: "/v1/{+parent}/schemas:validateMessage"
tags: ["projects"]
---

# POST /v1/{+parent}/schemas:validateMessage

`POST /v1/{+parent}/schemas:validateMessage`

Validates a message against a schema.

## Path parameters

- `parent` string, required

## Request body

- ValidateMessageRequest — Request for the `ValidateMessage` method.
  - `encoding` 'ENCODING_UNSPECIFIED' | 'JSON' | 'BINARY' — The encoding expected for messages
  - `name` string — Name of the schema against which to validate. Format is `projects/{project}/schemas/{schema}`.
  - `message` string, byte — Message to validate against the provided `schema_spec`.
  - `schema` Schema — A schema resource.
    - `type` 'TYPE_UNSPECIFIED' | 'PROTOCOL_BUFFER' | 'AVRO' — The type of the schema definition.
    - `revisionCreateTime` string, google-datetime — Output only. The timestamp that the revision was created.
    - `name` string — Required. Name of the schema. Format is `projects/{project}/schemas/{schema}`.
    - `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.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/pubsub.md) · [All operations](https://skmtc.net/google/apis/pubsub/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/pubsub/versions/bf72396b5785/schema)
