---
title: "Add a domain name to a website"
method: POST
path: "/v1/hosting/websites/{website_id}/domain-name"
tags: ["Domain"]
---

# Add a domain name to a website

`POST /v1/hosting/websites/{website_id}/domain-name`

## Request

- Base URL: `https://api.10web.io`
- URL: `https://api.10web.io/v1/hosting/websites/{website_id}/domain-name`
- Auth: none declared. Required headers: `x-api-key`
- TypeScript: <https://skmtc.dev/10web/apis/10web-api-v1/docs/v1/hosting/websites/:website_id/domain-name/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `website_id` integer, required

## Headers

- `x-api-key` string, required

## Request body

- AddDomainNameRequest
  - `domain_name` string, required: Domain name to add (valid domain name format)

## Response `200`

Domain name added successfully

- AddDomainNameResponse
  - `status` 'ok' | 'error'
  - `data` object
    - `domain_name` string: The added domain name
    - `id` integer: The ID of the added domain name
    - `message` string: A success message
    - `nameservers` string: JSON string containing an array of nameserver addresses
    - `status` 'ok' | 'error': Status of the operation

## Other responses

- `400`: Bad request
- `403`: Unauthorized access
- `429`: Too many requests
- `500`: Something went wrong

---

[API](https://skmtc.dev/10web/apis/10web-api-v1.md) - [All operations](https://skmtc.dev/10web/apis/10web-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/10web/apis/10web-api-v1/revisions/01afc9651dfc?raw)
