Skip to content
Start here

Update Registration

client.registrar.registrations.edit(stringdomainName, RegistrationEditParams { account_id, auto_renew, Prefer } params, RequestOptionsoptions?): WorkflowStatus { completed, created_at, links, 4 more }
PATCH/accounts/{account_id}/registrar/registrations/{domain_name}

Updates an existing domain registration.

By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return 200 OK with a completed workflow status.

If the update is still processing after this synchronous wait window, the server returns 202 Accepted. Poll the URL in links.self to track progress.

To skip the wait and receive an immediate 202, send Prefer: respond-async.

This endpoint currently supports updating auto_renew only.

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
ParametersExpand Collapse
domainName: 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.

params: RegistrationEditParams { account_id, auto_renew, Prefer }
account_id: string

Path param: Identifier.

maxLength32
auto_renew?: boolean

Body param: Enable or disable automatic renewal. Setting this field to true authorizes Cloudflare to charge the account’s default payment method up to 30 days before domain expiry to renew the domain automatically. Renewal pricing may change over time based on registry pricing.

Prefer?: "respond-async"

Header param: Set to respond-async to receive an immediate 202 Accepted without waiting for the operation to complete (RFC 7240).

ReturnsExpand Collapse
WorkflowStatus { completed, created_at, links, 4 more }

Status of an async registration workflow.

completed: boolean

Indicates whether the workflow reached a terminal state. A succeeded or failed state returns true; pending, in_progress, action_required, and blocked return false.

created_at: string
formatdate-time
state: "pending" | "in_progress" | "action_required" | 3 more

Describes the workflow lifecycle state.

  • pending: The workflow awaits processing.
  • in_progress: Processing started. Continue polling links.self. An internal deadline limits the duration of this state.
  • action_required: The workflow pauses for user action. See context.action for details. Stop automated polling until the user completes the required action.
  • blocked: A third party, such as the domain extension’s registry or a losing registrar, prevents progress. Continue polling because the block may resolve when the third party responds.
  • succeeded: Terminal state. The operation completed successfully. completed equals true. For registrations, context.registration contains the resulting registration resource.
  • failed: Terminal state. The operation failed. completed equals true. See error.code and error.message for the reason. Require user review before retrying.
One of the following:
"pending"
"in_progress"
"action_required"
"blocked"
"succeeded"
"failed"
updated_at: string
formatdate-time
context?: Record<string, unknown>

Provides workflow-specific data.

For domain-centric workflows, context.domain_name identifies the workflow subject.

error?: Error | null

Provides error details when a workflow reaches the failed state. The workflow type (registration, update, etc.) and underlying registry response determine the specific codes and messages. Workflow error codes differ from immediate HTTP error errors[].code values in non-2xx responses. Surface error.message to the user for context.

code: string

Machine-readable error code identifying the failure reason.

message: string

Human-readable explanation of the failure. May include registry-specific details.

Update Registration

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const workflowStatus = await client.registrar.registrations.edit('example.com', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(workflowStatus.completed);
{
  "errors": [],
  "messages": [],
  "result": {
    "completed": true,
    "context": {
      "domain_name": "example.com",
      "registration": {
        "auto_renew": true,
        "created_at": "2025-01-15T10:00:00Z",
        "domain_name": "example.com",
        "expires_at": "2026-01-15T10:00:00Z",
        "locked": true,
        "privacy_mode": "redaction",
        "status": "active"
      }
    },
    "created_at": "2025-10-27T10:00:00Z",
    "links": {
      "resource": "/accounts/abc/registrar/registrations/example.com",
      "self": "/accounts/abc/registrar/registrations/example.com/update-status"
    },
    "state": "succeeded",
    "updated_at": "2025-10-27T10:00:02Z"
  },
  "success": true
}
{
  "errors": [],
  "messages": [],
  "result": {
    "completed": false,
    "context": {
      "domain_name": "example.com"
    },
    "created_at": "2025-10-27T10:00:00Z",
    "links": {
      "resource": "/accounts/abc/registrar/registrations/example.com",
      "self": "/accounts/abc/registrar/registrations/example.com/update-status"
    },
    "state": "in_progress",
    "updated_at": "2025-10-27T10:00:10Z"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Domain not found"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Must be a boolean if present",
      "source": {
        "pointer": "/auto_renew"
      }
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": {
    "completed": true,
    "context": {
      "domain_name": "example.com",
      "registration": {
        "auto_renew": true,
        "created_at": "2025-01-15T10:00:00Z",
        "domain_name": "example.com",
        "expires_at": "2026-01-15T10:00:00Z",
        "locked": true,
        "privacy_mode": "redaction",
        "status": "active"
      }
    },
    "created_at": "2025-10-27T10:00:00Z",
    "links": {
      "resource": "/accounts/abc/registrar/registrations/example.com",
      "self": "/accounts/abc/registrar/registrations/example.com/update-status"
    },
    "state": "succeeded",
    "updated_at": "2025-10-27T10:00:02Z"
  },
  "success": true
}
{
  "errors": [],
  "messages": [],
  "result": {
    "completed": false,
    "context": {
      "domain_name": "example.com"
    },
    "created_at": "2025-10-27T10:00:00Z",
    "links": {
      "resource": "/accounts/abc/registrar/registrations/example.com",
      "self": "/accounts/abc/registrar/registrations/example.com/update-status"
    },
    "state": "in_progress",
    "updated_at": "2025-10-27T10:00:10Z"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Domain not found"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Must be a boolean if present",
      "source": {
        "pointer": "/auto_renew"
      }
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}