# Connect a name

`POST /hosting/sites/{id}/domains` · Rivier · hosting

Connect a name. Control is proven by the name pointing at the site; the certificate is obtained before the first visitor.

- Scope: hosting:write
- Mcp: rivier_hosting_domain_add
- Graphql: Mutation.hostingDomainAdd
- Sdk: hosting.domain.add
- Cli: hosting domain add
- Events: hosting.domain.added

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "host": {
      "type": "string",
      "minLength": 4,
      "maxLength": 253
    },
    "method": {
      "type": "string",
      "enum": [
        "buy",
        "delegation",
        "connector",
        "domain_connect",
        "watch"
      ]
    },
    "wildcard": {
      "type": "boolean"
    },
    "canonical": {
      "type": "string",
      "enum": [
        "www",
        "apex"
      ]
    }
  },
  "required": [
    "host"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/hosting/sites/{id}/domains' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "host": "string"
}'
```
