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

# Create new domain

`POST /domains`

## Request body

- DomainInput
  - `name` string, required
  - `status` 'active' | 'inactive'
  - `sslEnabled` boolean
  - `modsecEnabled` boolean
  - `upstreams` UpstreamInput[]
    - `host` string, required
    - `port` integer, required
    - `weight` integer
    - `maxFails` integer
    - `failTimeout` integer
  - `loadBalancer` LoadBalancerInput
    - `algorithm` 'round-robin' | 'least-conn' | 'ip-hash'
    - `healthCheck` HealthCheckInput
      - `enabled` boolean
      - `interval` integer
      - `timeout` integer
      - `path` string

## Response `201`

Domain created

- Domain
  - `id` string
  - `name` string
  - `status` 'active' | 'inactive' | 'error'
  - `sslEnabled` boolean
  - `sslExpiry` string, date
  - `modsecEnabled` boolean
  - `upstreams` Upstream[]
    - `id` string
    - `host` string
    - `port` integer
    - `weight` integer
    - `maxFails` integer
    - `failTimeout` integer
    - `status` 'up' | 'down' | 'checking'
  - `loadBalancer` LoadBalancer
    - `algorithm` 'round-robin' | 'least-conn' | 'ip-hash'
    - `healthCheck` HealthCheck
      - `enabled` boolean
      - `interval` integer
      - `timeout` integer
      - `path` string
  - `createdAt` string, date-time
  - `lastModified` string, date-time

---

[API](https://skmtc.dev/tinyactive/apis/nginx-modsecurity-admin-portal-api.md) · [All operations](https://skmtc.dev/tinyactive/apis/nginx-modsecurity-admin-portal-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tinyactive/nginx-modsecurity-admin-portal-api/revisions/9df19884247b/schema)
