---
title: "Claim App Domain"
method: POST
path: "/apps/{app_id}/domains"
tags: ["App Domains"]
---

# Claim App Domain

`POST /apps/{app_id}/domains`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/apps/{app_id}/domains`
- Auth: HTTP bearer

Claim a hostname and return the TXT record proving you control it.

409 when another app already holds the host. Hostnames are globally unique,
and a silent overwrite would let one builder take another's traffic -- which
is why `claim_domain` raises rather than upserting.

## Path parameters

- `app_id` string, required

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Request body

- ClaimDomainRequest
  - `hostname` string, required: The hostname to serve this app on. Normalized server-side: case, a trailing dot and unicode all resolve to one canonical form.

## Response `201`

Successful Response

- ApiResponseDomainVerificationInstructions
  - `data` DomainVerificationInstructions, required: Everything the builder needs to prove control, and nothing else. The token is returned ONLY here, at claim time. It is also stored, but there is deliberately no route that reads it back: a token readable on demand is a token an attacker with a stolen read-only key can harvest for every pending domain on the platform.
    - `domain` DomainResponse, required
      - `domain_id` string, required
      - `app_id` string, required
      - `hostname` string, required: The canonical, normalized form -- not necessarily what was submitted.
      - `status` string, required
      - `created_at` string, date-time, nullable
      - `verified_at` string, date-time, nullable
    - `record_type` string
    - `record_name` string, required: Create the record at this name, e.g. _graph8-challenge.app.example.com
    - `record_value` string, required
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
