# set_domain_auto_renew

Source: https://modulify.ai/docs/mcp/bought-domains/set-domain-auto-renew

Turns auto-renew of a domain the workspace bought on or off.

- Title: Turn auto-renew of a bought domain on or off
- Scope: `domains:buy`
- Access: Destructive

While auto-renew is on, Modulify renews the domain itself before it expires. It tries 14, 7, 3 and 1 days before `Expires_At`, checked every hour, and renews for `RenewalYears` years, the shortest renewal term, at `RenewalPriceCents`. Name.com's own auto renew always stays off, so Name.com never charges anyone by itself.

No checkout opens. Modulify charges the saved card of whoever the token belongs to, the default card in their billing details, and that person must still be allowed to manage the workspace's billing when it tries. Turning it on means that card is charged later without anyone being asked again, so the tool tells the client to confirm with you first, with the price and the date. It is refused while you have no saved card, with `Add a card to your billing details first, then turn on auto-renew!`, and paying on a `buy_domain` or `renew_domain` link does not save one.

When the card is declined or missing, or the bank asks to confirm the payment, that attempt fails, nothing is charged, the workspace owner and members are emailed the reason and the next attempt tries again. If the registrar refuses the renewal after payment, the payment is refunded. Nothing is tried after `Expires_At`, so an expired domain is renewed with `renew_domain`, until its `RenewBy`. A failed attempt shows in `AutoRenew_Failed_At` and `AutoRenew_Error`, and turning auto-renew off and on again clears it and makes Modulify try again within the hour when the domain is in its last 14 days. While it is off, the domain is renewed only once its renewal is paid. A workspace transfer turns it off for every domain of the workspace, and the new owner turns it on again to have them renewed on their own card.

The answer is the domain as `get_bought_domain` reads it, with `AutoRenew` and `AutoRenew_By`, the id of the person whose card is charged. Only the workspace owner can do this, and the domain must be `active` or `expiring`. The workspace can make 30 domain changes a minute, shared with the **Domains** page and covering DNS records, nameservers, the registrant, the transfer lock, auto-renew and transfer codes, and a refusal says how long to wait. See [Auto-renew](https://modulify.ai/docs/publish/buy-a-domain#auto-renew).

## 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`. |
| `enabled` | boolean | Yes | True turns auto-renew on, false turns it off. |