---
title: "Attach a hostname to a suite"
description: "Route a hostname to this suite so people can sign in there and each app responds under its slug, such as `/crm` or `/hr`; one address serves every app."
canonical: "https://grid82.com/docs/builder-api/domains/attach"
updated: "2026-11-13"
---

# Attach a hostname to a suite

`POST https://studio.grid82.app/v1/suites/{suiteId}/domains`

Route a hostname to this suite so people can sign in there and each app responds under its slug, such as `/crm` or `/hr`; one address serves every app.

The platform subdomain is active immediately. Custom hostnames are a paid option and must be subdomains, such as `app.example.com`, not `example.com`; they start as `pending`, and the response includes a TXT record to prove ownership and a CNAME to route traffic here. Publish both records, then call `domains.verify`: after the TXT record appears, the hostname becomes `provisioning` while a certificate is issued, then `active` when it serves. Refuse hostnames already answered by another organisation.

Requires the `schema:write` scope. Operation `domains.attach`. MCP tool `domains_attach`. CLI: `grid82 domains attach` (`npx grid82`).

## Path parameters

| Name      | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `suiteId` | string | yes      |             |

## Headers

| Name              | Type   | Required | Description                                                                                                                                                                                                                                                        |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Idempotency-Key` | string | no       | Any unique string. Sending the same key with the same request again returns the first response (marked `Idempotency-Replayed: true`) instead of running it twice. Reusing it for a different request is refused with 409. Kept for 24 hours. Up to 255 characters. |

## Request body

| Field      | Type   | Required | Description           |
| ---------- | ------ | -------- | --------------------- |
| `hostname` | string | yes      | Up to 253 characters. |

**Authorizations**

- `Authorization` (bearer, in header, required)

## Response

**201**: Success

- `data` (`object`, required)
- `data.hostname` (`string`, required)
- `data.status` (`enum<string>`, required, one of: `active, pending, provisioning`)
- `data.dns` (`object`, required)
- `data.dns.type` (`string`, required)
- `data.dns.name` (`string`, required)
- `data.dns.value` (`string`, required)
- `data.verification` (`object`)
- `data.verification.type` (`string`, required)
- `data.verification.name` (`string`, required)
- `data.verification.value` (`string`, required)

```json
{
  "data": {
    "hostname": "<string>",
    "status": "active",
    "dns": {
      "type": "<string>",
      "name": "<string>",
      "value": "<string>"
    },
    "verification": {
      "type": "<string>",
      "name": "<string>",
      "value": "<string>"
    }
  }
}
```

**4XX**: Refused

- `error` (`object`, required)
- `error.code` (`enum<string>`, required, one of: `not_found, forbidden, unauthenticated, validation_failed, conflict, rate_limited, payment_required, not_implemented, internal`)
- `error.message` (`string`, required)
- `error.details` (`Record<string, unknown>`)

```json
{
  "error": {
    "code": "not_found",
    "message": "<string>",
    "details": {}
  }
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://studio.grid82.app/v1/suites/<suiteId>/domains' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "hostname": "<string>"
}'
```
