Skip to content
Start here

Get Registration

client.Registrar.Registrations.Get(ctx, domainName, query) (*Registration, error)
GET/accounts/{account_id}/registrar/registrations/{domain_name}

Returns the current state of a domain registration.

This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both created_at and expires_at are present in the response.

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

Fully qualified domain name (FQDN) including the extension (e.g., example.com, mybrand.app). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.

query RegistrationGetParams
AccountID param.Field[string]Optional

Identifier

maxLength32
ReturnsExpand Collapse
type Registration struct{…}

A domain registration resource representing the current state of a registered domain.

AutoRenew bool

Whether the domain will be automatically renewed before expiration.

CreatedAt Time

When the domain was registered. Present when the registration resource exists.

formatdate-time
DomainName string

Fully qualified domain name (FQDN) including the extension (e.g., example.com, mybrand.app). The domain name uniquely identifies a registration — the same domain cannot be registered twice, making it a natural idempotency key for registration requests.

ExpiresAt Time

When the domain registration expires. Present when the registration is ready; may be null only while status is registration_pending.

formatdate-time
Locked bool

Whether the domain is locked for transfer.

PrivacyMode RegistrationPrivacyMode

Current WHOIS privacy mode for the registration.

Status RegistrationStatus

Current registration status.

  • active: Domain is registered and operational
  • registration_pending: Registration is in progress
  • expired: Domain has expired
  • suspended: Domain is suspended by the registry
  • redemption_period: Domain is in the redemption grace period
  • pending_delete: Domain is pending deletion by the registry
One of the following:
const RegistrationStatusActive RegistrationStatus = "active"
const RegistrationStatusRegistrationPending RegistrationStatus = "registration_pending"
const RegistrationStatusExpired RegistrationStatus = "expired"
const RegistrationStatusSuspended RegistrationStatus = "suspended"
const RegistrationStatusRedemptionPeriod RegistrationStatus = "redemption_period"
const RegistrationStatusPendingDelete RegistrationStatus = "pending_delete"

Get Registration

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/registrar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  registration, err := client.Registrar.Registrations.Get(
    context.TODO(),
    "example.com",
    registrar.RegistrationGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", registration.AutoRenew)
}
{
  "errors": [],
  "messages": [],
  "result": {
    "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"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Domain not found"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Invalid domain name"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": {
    "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"
  },
  "success": true
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Domain not found"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 10000,
      "message": "Invalid domain name"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}