---
title: "Bind a host. Hosts are created unverified — call /verify after publishing the TXT challenge."
method: POST
path: "/api/v1/domains"
tags: ["Domains"]
---

# Bind a host. Hosts are created unverified — call /verify after publishing the TXT challenge.

`POST /api/v1/domains`

## Request

- Base URL: `https://qrlia.dev.castlesoft.eu`
- URL: `https://qrlia.dev.castlesoft.eu/api/v1/domains`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `qrc_session`

## Request body

- object
  - `host` string, required: RFC 1035 hostname, lowercase. Trailing dots are stripped.
  - `role` 'portal' | 'redirect' | 'landing', required: `portal` = login + admin UI. `redirect` = short-link host. `landing` = public landing pages.
  - `companyId` string, uuid, nullable: Pin to a company (white-label). Omit for tenant-wide hosts.

## Response `201`

Created

- Domain
  - `id` string, uuid, required
  - `host` string, required
  - `role` 'portal' | 'redirect' | 'landing', required: `portal` = login + admin UI. `redirect` = short-link host. `landing` = public landing pages.
  - `tenantId` string, uuid, required
  - `companyId` string, uuid, nullable, required
  - `isPrimary` boolean, required
  - `verifiedAt` string, date-time, nullable, required
  - `createdAt` string, date-time, required
  - `verification` object, required
    - `txtName` string, required
    - `txtValue` string, required

## Other responses

- `400`: Validation failed
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict
- `500`: Internal

---

[API](https://skmtc.dev/qrlia/apis/qrlia-api.md) · [All operations](https://skmtc.dev/qrlia/apis/qrlia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qrlia/apis/qrlia-api/revisions/01c5dd6002ab?raw)
