---
title: "Compile a schema."
method: POST
path: "/schema/compile"
tags: ["Schema Operations"]
---

# Compile a schema.

`POST /schema/compile`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/schema/compile`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/schema/compile/post.ts> (a function with typed inputs; its response is checked against the schema)

Any authenticated user has permission to perform this operation.

## Request body

- object
  - `content` string, required: The schema object to compile
  - `type` 'JSON' | 'JSON_SAMPLE' | 'AVRO' | 'PROTOBUF', required: The type of schema to compile

## Response `201`

A schema response.

- object
  - `schema` object[]: Record schema.
    - `name` string: The field name.
    - `type` string: The field type.

## Other responses

- `400`: An invalid request was received.
- `default`: An error has occurred.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
