---
title: "Add subdomain"
method: POST
path: "/v1/teams/{teamId}/domains/{domain}/subdomains"
tags: ["Domains", "team"]
---

# Add subdomain

`POST /v1/teams/{teamId}/domains/{domain}/subdomains`

## Request

- Base URL: `https://placeholder/v1`
- URL: `https://placeholder/v1/v1/teams/{teamId}/domains/{domain}/subdomains`
- Auth: none required
- TypeScript: <https://skmtc.dev/northflank/apis/northflank-api/docs/v1/teams/:teamId/domains/:domain/subdomains/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds a new subdomain to the domain.

## Path parameters

- `teamId` string, required
- `domain` string, required: Name of the domain

## Request body

- object
  - `subdomain` string, required: A subdomain to be added.
  - `routingMode` 'paths' | 'geoRouting' | 'loadBalancerSubdomain': The routing mode for the subdomain. Determines how traffic is routed. Once set, this cannot be changed.
  - `cdn` object: Optional CDN configuration.
    - `northflank` object
      - `enabled` boolean, required
  - `options` object: Optional advanced configuration for the subdomain.
    - `tlsMode` 'default' | 'passthrough': Desired TLS mode for the subdomain.
    - `minTlsProtocolVersion` 'TLSV1_1' | 'TLSV1_2' | 'TLSV1_3': Minimum TLS protocol version for the subdomain. Only applicable for non-wildcard subdomains.
    - `autoVerify` boolean: The domain will be automatically verified on creation. Only configurable if the relevant feature flag is enabled for you account.
    - `aliasDomains` string[]: Alias domains which should be routable. Only configurable if the relevant feature flag is enabled for you account.

## Response `200`

Details about the newly added subdomain.

## Other responses

- `400`: The subdomain is not valid (possibly because it is too long) or the domain has not been verified.
- `409`: The subdomain has already been added to this domain.

---

[API](https://skmtc.dev/northflank/apis/northflank-api.md) - [All operations](https://skmtc.dev/northflank/apis/northflank-api/llms.txt) - [OpenAPI document](https://skmtc.dev/northflank/apis/northflank-api/revisions/6511db980148?raw)
