# Domain routes: transfer, verify

URL: /code/api/domain/verbs-transfer · Id: `page:code/api/domain/verbs-transfer`

> The Domain Verbs transfer, verify as api.sb routes, with inputs, result, refusals and an example.

Reference for [Domain](/business/nouns/domain), one group of [Domain routes](/code/api/domain).

### Domain.transfer
Transfer moves a Domain’s registration to another holder or registrar, with its records intact. [Verb page](/business/nouns/domain/transfer?interface=api).

```text
POST /{namespace}/domains/{domain}/transfer
```

Path: `domain`. Body, as JSON: the other inputs. Emits [`Domain.transferred`](/business/events/Domain.transferred).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | [Domain](/business/nouns/domain) | Yes | The Domain to move. |
| `to` | `string` | Yes | The receiving holder or registrar. |
| `kind` | `string` | Yes | `in` from another registrar, `registrant` to a new owner, `push` between accounts, or `out` to leave. |
| `code` | [Secret](/business/nouns/secret) | No | The transfer code, for `in` and `out`. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | [Domain](/business/nouns/domain) | Yes | The transferred Domain. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
| Before `transferableAt` | [`refused`](/code/api/errors/refused) | Clear what the check names, then call it again. | None. |

**Example**

```bash
curl -X POST https://api.sb/kilnbakery.com/domains/domain_VbYut4CTsH/transfer \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"Example to","kind":"in"}'
```

```json
{
  "api": "https://api.sb/kilnbakery.com",
  "domain": {
    "$id": "https://api.sb/kilnbakery.com/domains/domain_VbYut4CTsH",
    "$type": "Domain",
    "hostname": "kilnbakery.com",
    "role": "canonical",
    "state": "verifying"
  },
  "action": {
    "$id": "https://api.sb/kilnbakery.com/actions/act_0y76a1jB6k",
    "operation": "Domain.transfer",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/kilnbakery.com/actions/act_0y76a1jB6k"
  }
}
```

### Domain.verify
Verify checks a Domain’s DNS, ownership and certificate again and records each result, with the fix for any failure. [Verb page](/business/nouns/domain/verify?interface=api).

```text
POST /{namespace}/domains/{domain}/verify
```

Path: `domain`. Emits [`Domain.verified`](/business/events/Domain.verified).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | [Domain](/business/nouns/domain) | Yes | The Domain to check. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `checks` | `json` | Yes | Each check with its status and, on failure, its reason and fix. |
| `domain` | [Domain](/business/nouns/domain) | Yes | The Domain with its `state` after the checks. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/kilnbakery.com/domains/domain_VbYut4CTsH/verify \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/kilnbakery.com",
  "checks": {},
  "domain": {
    "$id": "https://api.sb/kilnbakery.com/domains/domain_VbYut4CTsH",
    "$type": "Domain",
    "hostname": "kilnbakery.com",
    "role": "canonical",
    "state": "verifying"
  },
  "action": {
    "$id": "https://api.sb/kilnbakery.com/actions/act_0y76a1jB6k",
    "operation": "Domain.verify",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/kilnbakery.com/actions/act_0y76a1jB6k"
  }
}
```