## List domains `client.Registrar.Domains.List(ctx, query) (*SinglePage[Domain], error)` **get** `/accounts/{account_id}/registrar/domains` List domains handled by Registrar. ### Parameters - `query DomainListParams` - `AccountID param.Field[string]` Identifier ### Returns - `type Domain struct{…}` - `ID string` Domain identifier. - `Available bool` Shows if a domain is available for transferring into Cloudflare Registrar. - `CanRegister bool` Indicates if the domain can be registered as a new domain. - `CreatedAt Time` Shows time of creation. - `CurrentRegistrar string` Shows name of current registrar. - `ExpiresAt Time` Shows when domain name registration expires. - `Locked bool` Shows whether a registrar lock is in place for a domain. - `RegistrantContact DomainRegistrantContact` Shows contact information for domain registrant. - `Address string` Address. - `City string` City. - `Country string` The country in which the user lives. - `FirstName string` User's first name - `LastName string` User's last name - `Organization string` Name of organization. - `Phone string` User's telephone number - `State string` State. - `Zip string` The zipcode or postal code where the user lives. - `ID string` Contact Identifier. - `Address2 string` Optional address line for unit, floor, suite, etc. - `Email string` The contact email address of the user. - `Fax string` Contact fax number. - `RegistryStatuses string` A comma-separated list of registry status codes. A full list of status codes can be found at [EPP Status Codes](https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en). - `SupportedTLD bool` Whether a particular TLD is currently supported by Cloudflare Registrar. Refer to [TLD Policies](https://www.cloudflare.com/tld-policies/) for a list of supported TLDs. - `TransferIn DomainTransferIn` Statuses for domain transfers into Cloudflare Registrar. - `AcceptFoa DomainTransferInAcceptFoa` Form of authorization has been accepted by the registrant. - `const DomainTransferInAcceptFoaNeeded DomainTransferInAcceptFoa = "needed"` - `const DomainTransferInAcceptFoaOk DomainTransferInAcceptFoa = "ok"` - `ApproveTransfer DomainTransferInApproveTransfer` Shows transfer status with the registry. - `const DomainTransferInApproveTransferNeeded DomainTransferInApproveTransfer = "needed"` - `const DomainTransferInApproveTransferOk DomainTransferInApproveTransfer = "ok"` - `const DomainTransferInApproveTransferPending DomainTransferInApproveTransfer = "pending"` - `const DomainTransferInApproveTransferTrying DomainTransferInApproveTransfer = "trying"` - `const DomainTransferInApproveTransferRejected DomainTransferInApproveTransfer = "rejected"` - `const DomainTransferInApproveTransferUnknown DomainTransferInApproveTransfer = "unknown"` - `CanCancelTransfer bool` Indicates if cancellation is still possible. - `DisablePrivacy DomainTransferInDisablePrivacy` Privacy guards are disabled at the foreign registrar. - `const DomainTransferInDisablePrivacyNeeded DomainTransferInDisablePrivacy = "needed"` - `const DomainTransferInDisablePrivacyOk DomainTransferInDisablePrivacy = "ok"` - `const DomainTransferInDisablePrivacyUnknown DomainTransferInDisablePrivacy = "unknown"` - `EnterAuthCode DomainTransferInEnterAuthCode` Auth code has been entered and verified. - `const DomainTransferInEnterAuthCodeNeeded DomainTransferInEnterAuthCode = "needed"` - `const DomainTransferInEnterAuthCodeOk DomainTransferInEnterAuthCode = "ok"` - `const DomainTransferInEnterAuthCodePending DomainTransferInEnterAuthCode = "pending"` - `const DomainTransferInEnterAuthCodeTrying DomainTransferInEnterAuthCode = "trying"` - `const DomainTransferInEnterAuthCodeRejected DomainTransferInEnterAuthCode = "rejected"` - `UnlockDomain DomainTransferInUnlockDomain` Domain is unlocked at the foreign registrar. - `const DomainTransferInUnlockDomainNeeded DomainTransferInUnlockDomain = "needed"` - `const DomainTransferInUnlockDomainOk DomainTransferInUnlockDomain = "ok"` - `const DomainTransferInUnlockDomainPending DomainTransferInUnlockDomain = "pending"` - `const DomainTransferInUnlockDomainTrying DomainTransferInUnlockDomain = "trying"` - `const DomainTransferInUnlockDomainUnknown DomainTransferInUnlockDomain = "unknown"` - `UpdatedAt Time` Last updated. ### Example ```go 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"), ) page, err := client.Registrar.Domains.List(context.TODO(), registrar.DomainListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "ea95132c15732412d22c1476fa83f27a", "available": false, "can_register": false, "created_at": "2018-08-28T17:26:26Z", "current_registrar": "Cloudflare", "expires_at": "2019-08-28T23:59:59Z", "locked": false, "registrant_contact": { "address": "123 Sesame St.", "city": "Austin", "country": "US", "first_name": "John", "last_name": "Appleseed", "organization": "Cloudflare, Inc.", "phone": "+1 123-123-1234", "state": "TX", "zip": "12345", "id": "ea95132c15732412d22c1476fa83f27a", "address2": "Suite 430", "email": "user@example.com", "fax": "123-867-5309" }, "registry_statuses": "ok,serverTransferProhibited", "supported_tld": true, "transfer_in": { "accept_foa": "needed", "approve_transfer": "unknown", "can_cancel_transfer": true, "disable_privacy": "ok", "enter_auth_code": "needed", "unlock_domain": "ok" }, "updated_at": "2018-08-28T17:26:26Z" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ```