---
title: "Create domain"
method: POST
path: "/api/domains"
tags: ["Domains"]
---

# Create domain

`POST /api/domains`

Create a new domain with the given data. The maximum domain number is 1, once created, can not be modified, you'll have to delete and recreate one.

## Request body

- object
  - `domain` string, required — The domain name, e.g. `example.com`.

## Response `201`

The domain was created successfully.

- object
  - `id` string, required
  - `domain` string, required
  - `status` 'PendingVerification' | 'PendingSsl' | 'Active' | 'Error', required
  - `errorMessage` string, nullable, required
  - `dnsRecords` object[], required
    - `name` string, required
    - `type` string, required
    - `value` string, required
  - `createdAt` number, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `422` — Validation error. Please check the request body.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
