# get_domain_transfer_code

Source: https://modulify.ai/docs/api/bought-domains/get-domain-transfer-code

Returns the transfer code of a domain the workspace bought, which the registrar it moves to asks for.

- Title: Get the transfer code of a bought domain
- Scope: `credentials:reveal`
- Access: Read only
- Endpoint: `POST /v1/get_domain_transfer_code`

The code comes back in `AuthCode`, also called the auth code. It is a live credential: anyone holding it can move the domain away once its transfer lock is off, which is why the tool tells the client to hand the code only to you, and why it needs two scopes: `credentials:reveal` and `domains:write`. A token that holds only one of them does not see the tool, and a call with it is refused. Name.com does not give one out for a domain in its first 60 days or for 60 days after its owner changed.

Only the workspace owner can get it, and the domain must be `active` or `expiring`. Each code counts as a change toward the workspace's 30 domain changes a minute. See [Transfer code](https://modulify.ai/docs/publish/buy-a-domain#transfer-code).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_domain_transfer_code`, sending the inputs below as a JSON object. The token needs the `credentials:reveal` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_domain_transfer_code \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID","domainId":"DOMAIN_ID"}'
```

Over MCP, the same method is the [get_domain_transfer_code tool](https://modulify.ai/docs/mcp/bought-domains/get-domain-transfer-code).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace that owns the domain. |
| `domainId` | string | Yes | The `_id` of the bought domain, from `list_bought_domains`. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.