# Domains ## List domains `registrar.domains.list(DomainListParams**kwargs) -> SyncSinglePage[Domain]` **get** `/accounts/{account_id}/registrar/domains` List domains handled by Registrar. ### Parameters - `account_id: str` Identifier ### Returns - `class Domain: …` - `id: Optional[str]` Domain identifier. - `available: Optional[bool]` Shows if a domain is available for transferring into Cloudflare Registrar. - `can_register: Optional[bool]` Indicates if the domain can be registered as a new domain. - `created_at: Optional[datetime]` Shows time of creation. - `current_registrar: Optional[str]` Shows name of current registrar. - `expires_at: Optional[datetime]` Shows when domain name registration expires. - `locked: Optional[bool]` Shows whether a registrar lock is in place for a domain. - `registrant_contact: Optional[RegistrantContact]` Shows contact information for domain registrant. - `address: str` Address. - `city: str` City. - `country: Optional[str]` The country in which the user lives. - `first_name: Optional[str]` User's first name - `last_name: Optional[str]` User's last name - `organization: str` Name of organization. - `phone: Optional[str]` User's telephone number - `state: str` State. - `zip: Optional[str]` The zipcode or postal code where the user lives. - `id: Optional[str]` Contact Identifier. - `address2: Optional[str]` Optional address line for unit, floor, suite, etc. - `email: Optional[str]` The contact email address of the user. - `fax: Optional[str]` Contact fax number. - `registry_statuses: Optional[str]` 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). - `supported_tld: Optional[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. - `transfer_in: Optional[TransferIn]` Statuses for domain transfers into Cloudflare Registrar. - `accept_foa: Optional[Literal["needed", "ok"]]` Form of authorization has been accepted by the registrant. - `"needed"` - `"ok"` - `approve_transfer: Optional[Literal["needed", "ok", "pending", 3 more]]` Shows transfer status with the registry. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"rejected"` - `"unknown"` - `can_cancel_transfer: Optional[bool]` Indicates if cancellation is still possible. - `disable_privacy: Optional[Literal["needed", "ok", "unknown"]]` Privacy guards are disabled at the foreign registrar. - `"needed"` - `"ok"` - `"unknown"` - `enter_auth_code: Optional[Literal["needed", "ok", "pending", 2 more]]` Auth code has been entered and verified. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"rejected"` - `unlock_domain: Optional[Literal["needed", "ok", "pending", 2 more]]` Domain is unlocked at the foreign registrar. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"unknown"` - `updated_at: Optional[datetime]` Last updated. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.registrar.domains.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) page = page.result[0] print(page.id) ``` #### 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 } } ``` ## Get domain `registrar.domains.get(strdomain_name, DomainGetParams**kwargs) -> object` **get** `/accounts/{account_id}/registrar/domains/{domain_name}` Show individual domain. ### Parameters - `account_id: str` Identifier - `domain_name: str` Domain name. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) domain = client.registrar.domains.get( domain_name="cloudflare.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(domain) ``` #### 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": {}, "success": true } ``` ## Update domain `registrar.domains.update(strdomain_name, DomainUpdateParams**kwargs) -> object` **put** `/accounts/{account_id}/registrar/domains/{domain_name}` Update individual domain. ### Parameters - `account_id: str` Identifier - `domain_name: str` Domain name. - `auto_renew: Optional[bool]` Auto-renew controls whether subscription is automatically renewed upon domain expiration. - `locked: Optional[bool]` Shows whether a registrar lock is in place for a domain. - `privacy: Optional[bool]` Privacy option controls redacting WHOIS information. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) domain = client.registrar.domains.update( domain_name="cloudflare.com", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(domain) ``` #### 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": {}, "success": true } ``` ## Domain Types ### Domain - `class Domain: …` - `id: Optional[str]` Domain identifier. - `available: Optional[bool]` Shows if a domain is available for transferring into Cloudflare Registrar. - `can_register: Optional[bool]` Indicates if the domain can be registered as a new domain. - `created_at: Optional[datetime]` Shows time of creation. - `current_registrar: Optional[str]` Shows name of current registrar. - `expires_at: Optional[datetime]` Shows when domain name registration expires. - `locked: Optional[bool]` Shows whether a registrar lock is in place for a domain. - `registrant_contact: Optional[RegistrantContact]` Shows contact information for domain registrant. - `address: str` Address. - `city: str` City. - `country: Optional[str]` The country in which the user lives. - `first_name: Optional[str]` User's first name - `last_name: Optional[str]` User's last name - `organization: str` Name of organization. - `phone: Optional[str]` User's telephone number - `state: str` State. - `zip: Optional[str]` The zipcode or postal code where the user lives. - `id: Optional[str]` Contact Identifier. - `address2: Optional[str]` Optional address line for unit, floor, suite, etc. - `email: Optional[str]` The contact email address of the user. - `fax: Optional[str]` Contact fax number. - `registry_statuses: Optional[str]` 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). - `supported_tld: Optional[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. - `transfer_in: Optional[TransferIn]` Statuses for domain transfers into Cloudflare Registrar. - `accept_foa: Optional[Literal["needed", "ok"]]` Form of authorization has been accepted by the registrant. - `"needed"` - `"ok"` - `approve_transfer: Optional[Literal["needed", "ok", "pending", 3 more]]` Shows transfer status with the registry. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"rejected"` - `"unknown"` - `can_cancel_transfer: Optional[bool]` Indicates if cancellation is still possible. - `disable_privacy: Optional[Literal["needed", "ok", "unknown"]]` Privacy guards are disabled at the foreign registrar. - `"needed"` - `"ok"` - `"unknown"` - `enter_auth_code: Optional[Literal["needed", "ok", "pending", 2 more]]` Auth code has been entered and verified. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"rejected"` - `unlock_domain: Optional[Literal["needed", "ok", "pending", 2 more]]` Domain is unlocked at the foreign registrar. - `"needed"` - `"ok"` - `"pending"` - `"trying"` - `"unknown"` - `updated_at: Optional[datetime]` Last updated.