# Choose apex, subdomain or delegate hosting

`POST /workspace/domains/{d}/mode` · Rivier · domains

Choose apex, subdomain or delegate hosting.

- Scope: domains:write
- Sdk: domains.domain.setMode
- Cli: domains domain set mode

## Parameters

- `d` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "apex",
        "subdomain",
        "delegate"
      ]
    },
    "subLabel": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,30}$"
    }
  },
  "required": [
    "mode"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: 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/workspace/domains/{d}/mode' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "mode": "apex"
}'
```
