---
title: "write schema"
method: POST
path: "/v1/tenants/{tenant_id}/schemas/write"
tags: ["Schema"]
---

# write schema

`POST /v1/tenants/{tenant_id}/schemas/write`

## Path parameters

- `tenant_id` string, required

## Request body

- SchemaWriteBody — SchemaWriteRequest is the request message for the Write method in the Schema service. It contains tenant_id and the schema to be written.
  - `schema` string — schema is the string representation of the schema to be written.

## Response `200`

A successful response.

- SchemaWriteResponse — SchemaWriteResponse is the response message for the Write method in the Schema service. It returns the version of the written schema.
  - `schema_version` string — schema_version is the string that identifies the version of the written schema.

## Other responses

- `default` — An unexpected error response.

## Changes

- **2025-12-28** `f37e45046dd2` — 1 breaking
  - the `details/items/additionalProperties/` response's property type/format changed from `object`/`` to ``/`` for status `default`
- **2024-08-23** `f3b10e35081b` — 1 breaking, 2 info
  - added required request body
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `default`
- **2024-08-22** `282fb7ba2640` — 3 breaking
  - removed the request body
  - removed the media type `application/json` for the response with the status `200`
  - removed the media type `application/json` for the response with the status `default`
- **2024-03-19** `0bc305aa169f` — 1 breaking
  - the `details/items/additionalProperties/` response's property type/format changed from ``/`` to `object`/`` for status `default`

[Change history](https://skmtc.dev/permify/apis/permify-api/changes/v1/tenants/:tenant_id/schemas/write/post.md)

---

[API](https://skmtc.dev/permify/apis/permify-api.md) · [All operations](https://skmtc.dev/permify/apis/permify-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/permify/permify-api/revisions/73b7d5b3742e/schema)
