---
title: "Add custom domain"
method: POST
path: "/api/v1/apps/services/{service_id}/domains"
tags: ["Raff Apps"]
---

# Add custom domain

`POST /api/v1/apps/services/{service_id}/domains`

Attach a custom domain to a web service. The response carries the DNS
records to create — a CNAME to `cname_target` and a verification TXT
record. Verification and TLS issuance run automatically once the DNS
resolves.

## Path parameters

- `service_id` string, required

## Request body

- object
  - `domain` string, required

## Response `201`

Domain added (status `pending_dns`)

- object
  - `success` boolean
  - `domain` AppCustomDomain
    - `id` string, uuid
    - `service_id` string, uuid
    - `domain` string
    - `status` 'pending_dns' | 'verifying' | 'dns_verified' | 'issuing_cert' | 'active' | 'error'
    - `status_message` string
    - `cname_target` string — CNAME record to create at your DNS provider
    - `verification_txt_name` string — TXT record name for domain ownership verification
    - `verification_txt_value` string
    - `created_at` string, date-time
    - `last_checked_at` string, date-time

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required
- `404` — Resource not found

## Changes

- **2026-08-20** `efd3c11c5c92` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/apps/services/:service_id/domains/post.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
