---
title: "Create"
method: POST
path: "/config_schemas"
tags: ["Config Schemas"]
---

# Create

`POST /config_schemas`

Create a new config schema.

## Query parameters

- `expand` ConfigSchemaExpansion[]

## Request body

- CreateConfigSchemaRequest
  - `config_type_ref` ConfigTypeRef, required — A reference to a config type. At least one of `id` or `slug` must be provided. When both are provided, `id` takes precedence and `slug` is ignored.
    - `id` string — ID of the config type. Takes precedence over `slug` when both are provided.
    - `slug` string — An immutable, code-friendly name for the config type. Used only when `id` is not provided.
  - `instance_filepath` string — The absolute file system path config instances for this schema are written to.
  - `language` 'jsonschema' | 'cue', required
  - `format` 'json' | 'yaml' | 'cue', required
  - `documents` CreateSchemaDocument[], required — The schema document files.
    - `name` string, required — The name of this document.
    - `data` string, required — The raw document content.
  - `git_commit` CreateConfigSchemaGitCommitRequest
    - `commit_ref` GitCommitRef, required — A reference to a git commit. At least one of `id` or `sha` must be provided. When both are provided, `id` takes precedence and `sha` is ignored.
      - `id` string — ID of the git commit. Takes precedence over `sha` when both are provided.
      - `sha` string — The SHA hash of the git commit. Used only when `id` is not provided.
    - `schema_filepaths` string[], required — The file paths of the config schema files relative to the git repository root. JSON Schema only supports a single file for a schema. CUE support multiple files via [packages](https://cuelang.org/docs/references/spec/#packages).

## Response `200`

Successfully created the config schema.

- ConfigSchema
  - `object` 'config_schema', required — The object type, which is always `config_schema`.
  - `id` string, required — ID of the config schema.
  - `digest` string, required — The digest of the config schema.
  - `config_type_name` string, required — The name of the config type.
  - `instance_filepath` string, required — The absolute file system path where config instances for this schema are written.
  - `created_at` string, date-time, required — Timestamp of when the config schema was created.
  - `updated_at` string, date-time, required — Timestamp of when the config schema was last updated.
  - `config_type_id` string, required — ID of the config type.
  - `language` 'jsonschema' | 'cue', required
  - `format` 'json' | 'yaml' | 'cue', required
  - `documents` SchemaDocument[]
    - `id` string, required — The unique identifier for this document.
    - `name` string, required — The document filename.
    - `data` string, required — The raw document content.
  - `config_type` ConfigType
    - `object` 'config_type', required — The object type, which is always `config_type`.
    - `id` string, required — ID of the config type.
    - `name` string, required — Name of the config type.
    - `slug` string, required — An immutable, code-friendly name for the config type.
    - `created_at` string, date-time, required — Timestamp of when the config type was created.
    - `updated_at` string, date-time, required — Timestamp of when the config type was last updated.

---

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