---
title: "Create schema."
method: POST
path: "/domains/{domainId}/schemas"
tags: ["Domains"]
---

# Create schema.

`POST /domains/{domainId}/schemas`

## Request

- Base URL: `http://metadata.openintegrationhub.com/api/v1`
- URL: `http://metadata.openintegrationhub.com/api/v1/domains/{domainId}/schemas`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/openintegrationhub/apis/oih-metadata-service-rest-api/docs/domains/:domainId/schemas/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint is used to send new schema for a given domain.

## Path parameters

- `domainId` string, required

## Request body

- MutableSchema
  - `name` string, required
  - `description` string
  - `value` object
  - `owners` Owner[]
    - `id` string
    - `type` string: Type of Owner entity, e.g. GROUP, TENANT, USER, etc.

## Response `200`

successful operation

- object
  - `data` Schema
    - `name` string, required
    - `description` string
    - `value` object
    - `owners` Owner[]
      - `id` string
      - `type` string: Type of Owner entity, e.g. GROUP, TENANT, USER, etc.
    - `id` string, required
    - `uri` string, required
    - `createdAt` string, date-time, required: Client creation time
    - `updatedAt` string, date-time: Client update time

## Other responses

- `400`: Bad request

## Changes

- **2019-08-15** `834571f85ba3`: 1 info
  - added the non-success response with the status `400`
- **2019-08-08** `f73867fae82f`: 2 breaking, 1 warning
  - added `#/components/schemas/SchemaBase, subschema #2` to the request body `allOf` list
  - the request's body type changed from `object` to no type
  - removed the request property `data`
- **2019-07-08** `f3d6b449bc4f`: 1 info
  - the endpoint scheme security `BearerAuth` was added to the API
- **2019-07-08** `1746e9d51ff0`: 1 breaking, 1 warning, 2 info
  - removed the required property `data/allOf[#/components/schemas/MutableSchema]/allOf[#/components/schemas/SchemaBase]/uri` from the response with the `200` status
  - removed the request property `data/allOf[#/components/schemas/SchemaBase]/uri`
  - the endpoint scheme security `BearerAuth` was removed from the API
  - added the optional property `data/allOf[subschema #2]/uri` to the response with the `200` status
- **2019-07-05** `3b62c5b2416c`: 1 info
  - the endpoint scheme security `BearerAuth` was added to the API

[Operation history](https://skmtc.dev/openintegrationhub/apis/oih-metadata-service-rest-api/changes/domains/:domainId/schemas/post.md)

---

[API](https://skmtc.dev/openintegrationhub/apis/oih-metadata-service-rest-api.md) - [All operations](https://skmtc.dev/openintegrationhub/apis/oih-metadata-service-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openintegrationhub/apis/oih-metadata-service-rest-api/revisions/834571f85ba3?raw)
