---
title: "Create domain in workspace"
method: POST
path: "/api/v1/workspace/{workspace_id}/domains"
tags: ["Domains"]
---

# Create domain in workspace

`POST /api/v1/workspace/{workspace_id}/domains`

## Request

- Base URL: `https://api.linklyhq.com`
- URL: `https://api.linklyhq.com/api/v1/workspace/{workspace_id}/domains`
- Auth: API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/linklyhq/apis/linkly-url-shortener-api/docs/api/v1/workspace/:workspace_id/domains/post.ts> (a function with typed inputs; its response is checked against the schema)

Add a new custom domain to a specific workspace. You must configure a CNAME DNS record pointing to domains.linklyhq.com before adding the domain.

## Path parameters

- `workspace_id` string, required

## Request body

- object
  - `name` string, required: Domain name (e.g., links.example.com)

## Response `200`

Domain

- Domain: Response schema for a domain
  - `name` string, nullable
  - `workspace_id` integer, nullable

## Other responses

- `400`: Error
- `403`: Forbidden

---

[API](https://skmtc.dev/linklyhq/apis/linkly-url-shortener-api.md) - [All operations](https://skmtc.dev/linklyhq/apis/linkly-url-shortener-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linklyhq/apis/linkly-url-shortener-api/revisions/968598ef7055?raw)
