# Create renew

URL: https://docs.hanzo.ai/docs/openapi/domain/post-domain-renew

> Extends a domain your org already owns and answers the updated record with its new expiry alongside what was paid.

`POST /v1/domain/renew`

> [Domain →](https://docs.hanzo.ai/docs/openapi/domain) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/domain/renew` |
| **Method**    | `POST`                                 |
| **Operation** | `post_domain_renew`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Extends a domain your org already owns and answers the updated record with
its new expiry alongside what was paid.

Ownership is the gate: a name the caller's org does not hold is 404, so a renewal
can never reach another tenant's domain.

The price is re-quoted at the CURRENT renewal rate rather than the one paid at
purchase. If the registrar returns no renewal price the org's original price is
charged instead, so a renewal is never accidentally free. The balance is
authorized before the registrar is called and captured after it confirms — 402
when the prepaid balance cannot cover it, 503 when the deployment has no
registrar credentials. Requires a validated principal.

## Request

2 fields, body `application/json` (required).

| Field    | In   | Type            | Required | Description                                           |
| -------- | ---- | --------------- | -------- | ----------------------------------------------------- |
| `domain` | body | string          | yes      | Domain is the name to extend.                         |
| `years`  | body | integer (int64) | —        | Years is how much longer to hold it, defaulting to 1. |

## Response

| Status    | Body               | Meaning |
| --------- | ------------------ | ------- |
| `200`     | domain.RenewResult | ok      |
| `default` | problem-details    | refused |

`200` body — 10 fields.

| Field                 | In   | Type            | Always | Description                                      |
| --------------------- | ---- | --------------- | ------ | ------------------------------------------------ |
| `paidCents`           | body | integer (int64) | —      | what this renewal cost, in cents                 |
| `record`              | body | domain.Holding  | —      |                                                  |
| `record.costCents`    | body | integer (int64) | —      | wholesale cost                                   |
| `record.domain`       | body | string          | —      | the name owned                                   |
| `record.expiresAt`    | body | string          | —      | when the registration lapses, RFC3339            |
| `record.nameservers`  | body | string\[]       | —      | the authoritative nameservers the name points at |
| `record.order`        | body | integer (int64) | —      | registrar order id                               |
| `record.org`          | body | string          | —      | the org that owns the domain                     |
| `record.priceCents`   | body | integer (int64) | —      | what the customer paid (sell)                    |
| `record.registeredAt` | body | integer (int64) | —      | unix seconds                                     |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo domain renew --domain <domain>
```

**SDK**

**.ts**

```ts
import { Configuration, DomainApi } from 'hanzoai';

const api = new DomainApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postDomainRenew({ domain: "<domain>" });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DomainApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DomainApi(client).post_domain_renew(domain="<domain>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DomainAPI.PostDomainRenew(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, domain_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = domain_api::post_domain_renew(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DomainApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DomainApi(client).postDomainRenew();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/domain/renew \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "domain": "<domain>"
     }'
```

**MCP**

MCP reaches **domain** through the `domain` tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_domain_availability"
         }
       }
     }'
```

---

[Domain API](https://docs.hanzo.ai/docs/openapi/domain) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
