---
title: "Create domain"
method: POST
path: "/domains"
---

# Create domain

`POST /domains`

Create a new domain

## Request body

- object
  - `domain` string, required — The domain name.
  - `kind` 'front_end' | 'rest_api' | 'graphql_api', required — The kind of domain you want to add.
  - `zen_service_id` integer — The Zen service ID which shoud generate the OpenAPI spec. This, 'openapi_spec_base64' or 'openapi_spec_url' must be provided when using kind 'rest_api' or 'graphql_api'
  - `openapi_spec_base64` string — The base64 encoded JSON OpenAPI spec you want to use for this domain. This, 'zen_service_id' or 'openapi_spec_url' must be provided when using kind 'rest_api' or 'graphql_api'
  - `openapi_spec_url` string — The URL to the JSON OpenAPI spec you want to use for this domain. This, 'zen_service_id' or 'openapi_spec_base64' must be provided when using kind 'rest_api' or 'graphql_api'

## Response `201`

The domain has been successfully created

- object
  - `id` integer — The ID of the newly created domain in Aikido.

## Other responses

- `422` — One or more of the provided fields are invalid.

---

[API](https://skmtc.net/aikido/apis/authorization.md) · [All operations](https://skmtc.net/aikido/apis/authorization/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aikido/authorization/versions/5445e7c21137/schema)
