> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirurobotics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

> Create a new config schema.

| Scope                  | Required |
| ---------------------- | -------- |
| `config_schemas:write` | Yes      |

<Tip>Consider using the Miru CLI in a CI/CD pipeline to create config schemas instead of calling this endpoint directly.</Tip>


## OpenAPI

````yaml /references/platform-api/2026-03-09.yaml post /config_schemas
openapi: 3.0.3
info:
  title: Miru Platform API
  description: The API between Miru and any external client
  version: 2026-03-09.tetons
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  x-release-version: 2026-03-09.tetons
  x-git-commit:
    sha: a33cf62e35e950971e3c223d746ae8e4e6464442
    url: >-
      https://github.com/mirurobotics/openapi/commit/a33cf62e35e950971e3c223d746ae8e4e6464442
    message: |-
      refactor(stainless): rename config instance content method to download

      Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
    author: Benjamin Smidt
    branch: HEAD
    dirty: false
  x-build:
    built_at: '2026-03-08T22:30:32.695898+00:00'
servers:
  - url: https://api.mirurobotics.com/beta
    description: Miru Platform API
security:
  - ApiKeyAuth: []
paths:
  /config_schemas:
    parameters:
      - $ref: '#/components/parameters/MiruVersion'
    post:
      tags:
        - Config Schemas
      summary: Create
      description: Create a new config schema.
      operationId: createConfigSchema
      parameters:
        - $ref: '#/components/parameters/config_schema_expansions'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConfigSchemaRequest'
      responses:
        '200':
          description: Successfully created the config schema.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigSchema'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from miru_platform_sdk import Miru

            client = Miru(
                api_key=os.environ.get("MIRU_API_KEY"),  # This is the default and can be omitted
            )
            config_schema = client.config_schemas.create(
                config_type_ref={},
                documents=[{
                    "data": "data",
                    "name": "motion-control.json",
                }],
                format="json",
                language="jsonschema",
            )
            print(config_schema.id)
components:
  parameters:
    MiruVersion:
      name: Miru-Version
      in: header
      required: true
      schema:
        type: string
        example: 2026-03-09.tetons
      description: The API version the client was built against.
    config_schema_expansions:
      name: expand
      in: query
      required: false
      description: Fields to expand on the config schema resource.
      schema:
        type: array
        items:
          $ref: '#/components/schemas/ConfigSchemaExpansion'
        example:
          - documents
  schemas:
    CreateConfigSchemaRequest:
      title: Create Config Schema Request
      type: object
      required:
        - config_type_ref
        - language
        - format
        - documents
      properties:
        config_type_ref:
          $ref: '#/components/schemas/ConfigTypeRef'
        instance_filepath:
          type: string
          description: The file path for config instances created from this schema.
          example: /v1/motion-control.json
        language:
          $ref: '#/components/schemas/SchemaLanguage'
        format:
          $ref: '#/components/schemas/SchemaFormat'
        documents:
          type: array
          description: The schema document files.
          items:
            $ref: '#/components/schemas/CreateSchemaDocument'
        git_commit:
          description: The git commit to link to this config schema.
          allOf:
            - $ref: '#/components/schemas/CreateConfigSchemaGitCommitRequest'
    ConfigSchema:
      title: Config Schema
      allOf:
        - $ref: '#/components/schemas/BaseConfigSchema'
        - type: object
          properties:
            config_type:
              allOf:
                - $ref: '#/components/schemas/ConfigType'
              description: >-
                Expand the config type using 'expand=config_type' in the query
                string.
      example:
        object: config_schema
        id: cfg_sch_123
        digest: sha256:1234567890
        config_type_name: Motion Control
        instance_filepath: /srv/miru/configs/v1/motion-control.json
        created_at: '2021-01-01T00:00:00Z'
        updated_at: '2021-01-01T00:00:00Z'
        config_type_id: cfg_typ_123
        language: jsonschema
        format: json
    ConfigSchemaExpansion:
      type: string
      enum:
        - documents
        - config_type
      x-enum-varnames:
        - CONFIG_SCHEMA_EXPAND_DOCUMENTS
        - CONFIG_SCHEMA_EXPAND_CONFIG_TYPE
    ConfigTypeRef:
      title: Config Type Reference
      description: >-
        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.
      type: object
      properties:
        id:
          type: string
          example: cfg_123
          description: >-
            ID of the config type. Takes precedence over `slug` when both are
            provided.
        slug:
          type: string
          example: my-config-type
          description: >-
            An immutable, code-friendly name for the config type. Used only when
            `id` is not provided.
    SchemaLanguage:
      title: Schema Language
      type: string
      example: jsonschema
      enum:
        - jsonschema
        - cue
      x-enum-varnames:
        - JSONSCHEMA
        - CUE
    SchemaFormat:
      title: Schema Format
      type: string
      enum:
        - json
        - yaml
        - cue
      x-enum-varnames:
        - SCHEMA_FORMAT_JSON
        - SCHEMA_FORMAT_YAML
        - SCHEMA_FORMAT_CUE
    CreateSchemaDocument:
      title: Schema Document
      type: object
      required:
        - name
        - data
      properties:
        name:
          type: string
          description: The name of this document.
          example: motion-control.json
        data:
          type: string
          description: The raw document content.
    CreateConfigSchemaGitCommitRequest:
      title: Git Commit Request
      type: object
      required:
        - commit_ref
        - schema_filepaths
      properties:
        commit_ref:
          $ref: '#/components/schemas/GitCommitRef'
        schema_filepaths:
          type: array
          description: >-
            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).
          items:
            type: string
          example:
            - path/to/config/schema/robot1.cue
            - path/to/config/schema/robot2.cue
    BaseConfigSchema:
      title: Base Config Schema
      type: object
      required:
        - object
        - id
        - digest
        - config_type_name
        - instance_filepath
        - created_at
        - updated_at
        - config_type_id
        - language
        - format
      properties:
        object:
          type: string
          enum:
            - config_schema
          example: config_schema
          x-stainless-const: true
          description: The object type, which is always `config_schema`.
        id:
          type: string
          example: cfg_sch_123
          description: ID of the config schema.
        digest:
          type: string
          example: sha256:1234567890
          description: The digest of the config schema.
        config_type_name:
          type: string
          example: Motion Control
          description: The name of the config type.
        instance_filepath:
          type: string
          description: >-
            The absolute file system path where config instances for this schema
            are written.
          example: /srv/miru/configs/v1/motion-control.json
        created_at:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00Z'
          description: Timestamp of when the config schema was created.
        updated_at:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00Z'
          description: Timestamp of when the config schema was last updated.
        config_type_id:
          type: string
          example: cfg_typ_123
          description: ID of the config type.
        language:
          $ref: '#/components/schemas/SchemaLanguage'
        format:
          $ref: '#/components/schemas/SchemaFormat'
        documents:
          allOf:
            - $ref: '#/components/schemas/SchemaDocuments'
          description: >-
            Expand the config schema documents using `expand=documents` in the
            query string.
          example:
            - id: doc_123
              name: main.json
              data: |
                {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object"
                }
    ConfigType:
      allOf:
        - $ref: '#/components/schemas/BaseConfigType'
      example:
        object: config_type
        id: cfg_typ_123
        name: Motion Control
        slug: motion-control
        created_at: '2021-01-01T00:00:00Z'
        updated_at: '2021-01-01T00:00:00Z'
        created_by_id: usr_123
        updated_by_id: usr_123
    GitCommitRef:
      title: Git Commit Reference
      description: >-
        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.
      type: object
      properties:
        id:
          type: string
          description: >-
            ID of the git commit. Takes precedence over `sha` when both are
            provided.
          example: git_cmt_123
        sha:
          type: string
          description: The SHA hash of the git commit. Used only when `id` is not provided.
          example: 1a2b3c4d...
    SchemaDocuments:
      type: array
      items:
        $ref: '#/components/schemas/SchemaDocument'
      example:
        - id: doc_123
          name: main.json
          data: |
            {
              "$schema": "https://json-schema.org/draft/2020-12/schema",
              "type": "object"
            }
    BaseConfigType:
      title: Config Type
      type: object
      required:
        - object
        - id
        - name
        - slug
        - created_at
        - updated_at
      properties:
        object:
          type: string
          enum:
            - config_type
          example: config_type
          x-stainless-const: true
          description: The object type, which is always `config_type`.
        id:
          type: string
          example: cfg_123
          description: ID of the config type.
        name:
          type: string
          example: My Config Type
          description: Name of the config type.
        slug:
          type: string
          example: my-config-type
          description: An immutable, code-friendly name for the config type.
        created_at:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00Z'
          description: Timestamp of when the config type was created.
        updated_at:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00Z'
          description: Timestamp of when the config type was last updated.
    SchemaDocument:
      title: Schema Document
      type: object
      required:
        - id
        - name
        - data
      properties:
        id:
          type: string
          description: The unique identifier for this document.
          example: doc_123
        name:
          type: string
          description: The document filename.
          example: main.json
        data:
          type: string
          description: The raw document content.
      example:
        id: doc_123
        name: main.json
        data: |
          {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "type": "object"
          }
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: The API key to use for authentication.

````