Skip to content
Start here

Update domain

PUT/accounts/{account_id}/registrar/domains/{domain_name}

Updates an individual domain.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Path ParametersExpand Collapse
account_id: string

Identifier.

maxLength32
domain_name: string

Provides a fully qualified domain name (FQDN), including the extension (e.g., example.com, mybrand.app). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.

Body ParametersJSONExpand Collapse
auto_renew: optional boolean

Auto-renew controls whether subscription is automatically renewed upon domain expiration.

locked: optional boolean

Shows whether a registrar lock is in place for a domain.

privacy: optional boolean

Privacy option controls redacting WHOIS information.

ReturnsExpand Collapse
errors: array of object { code, message, source }
code: number
minimum1000
message: string
source: optional object { pointer }

Location of the invalid value that caused the error.

pointer: string

JSON Pointer to the invalid or missing request value.

messages: array of object { code, message, source }
code: number
minimum1000
message: string
source: optional object { pointer }

Location of the invalid value that caused the error.

pointer: string

JSON Pointer to the invalid or missing request value.

result: unknown
success: true

Whether the API call was successful.

Update domain

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/registrar/domains/$DOMAIN_NAME \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{
          "auto_renew": true,
          "privacy": true
        }'
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {},
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {},
  "success": true
}