---
title: "Create/Update Schema"
method: POST
path: "/v1/{workspace}/schema/{schema_slug}/"
---

# Create/Update Schema

`POST /v1/{workspace}/schema/{schema_slug}/`

Upset draft version of a JSON schema. Creates a new schema if it doesn't exist.

## Path parameters

- `workspace` string, required
- `schema_slug` string, required

## Query parameters

- `commit` boolean
- `commit_message` string

## Request body

- object
  - `name` string, required — Human-readable name of the schema
  - `description` string, nullable — Description of the schema. Can be used to describe which action this schema is linked to.
  - `json_schema` object, required — Structure of the workflow or event payload. Follows standard [json schema specification](https://json-schema.org/draft/2020-12/schema). You can link this schema to a workflow or event to validate their input payload in API response. Same schema can be linked to multiple workflows and events.

## Response `200`

Successfully retrieved schema object

- object
  - `slug` string — Unique identifier for the schema
  - `name` string — Human-readable name of the schema
  - `description` string, nullable — Description of the schema
  - `status` 'draft' | 'live' — Status of returned schema. By default, draft version is returned. You can set `mode=live` to fetch the live schema.
  - `hash` string — Git-like hash for version tracking
  - `json_schema` object, nullable — JSON schema passed in the request body.
  - `created_at` string, date-time — When the schema was created
  - `updated_at` string, date-time — When the schema was last updated
  - `commit_result` object, nullable — Commit result when commit=true is passed in query parameter
    - `is_committed` boolean — Whether the schema was successfully committed
    - `errors` string[] — List of errors if commit failed

## Other responses

- `400` — Invalid schema format
- `401` — Authentication failed
- `404` — Schema not found

---

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