# Addresses ## List destination addresses `email_routing.addresses.list(AddressListParams**kwargs) -> SyncV4PagePaginationArray[Address]` **get** `/accounts/{account_id}/email/routing/addresses` Lists existing destination addresses. ### Parameters - `account_id: str` Identifier. - `direction: Optional[Literal["asc", "desc"]]` Sorts results in an ascending or descending order. - `"asc"` - `"desc"` - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Maximum number of results per page. - `verified: Optional[Literal[true, false]]` Filter by verified destination addresses. - `true` - `false` ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) page = client.email_routing.addresses.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" } } ], "success": true, "result": [ { "id": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 1, "total_pages": 100 } } ``` ## Get a destination address `email_routing.addresses.get(strdestination_address_identifier, AddressGetParams**kwargs) -> Address` **get** `/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}` Gets information for a specific destination email already created. ### Parameters - `account_id: str` Identifier. - `destination_address_identifier: str` Destination address identifier. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) address = client.email_routing.addresses.get( destination_address_identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(address.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" } } ], "success": true, "result": { "id": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Create a destination address `email_routing.addresses.create(AddressCreateParams**kwargs) -> Address` **post** `/accounts/{account_id}/email/routing/addresses` Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used. ### Parameters - `account_id: str` Identifier. - `email: str` The contact email address of the user. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) address = client.email_routing.addresses.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", email="user@example.com", ) print(address.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" } } ], "success": true, "result": { "id": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Delete destination address `email_routing.addresses.delete(strdestination_address_identifier, AddressDeleteParams**kwargs) -> Address` **delete** `/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}` Deletes a specific destination address. ### Parameters - `account_id: str` Identifier. - `destination_address_identifier: str` Destination address identifier. ### Returns - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted ) address = client.email_routing.addresses.delete( destination_address_identifier="ea95132c15732412d22c1476fa83f27a", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(address.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" } } ], "success": true, "result": { "id": "ea95132c15732412d22c1476fa83f27a", "created": "2014-01-02T02:20:00Z", "email": "user@example.com", "modified": "2014-01-02T02:20:00Z", "tag": "ea95132c15732412d22c1476fa83f27a", "verified": "2014-01-02T02:20:00Z" } } ``` ## Domain Types ### Address - `class Address: …` - `id: Optional[str]` Destination address identifier. - `created: Optional[datetime]` The date and time the destination address has been created. - `email: Optional[str]` The contact email address of the user. - `modified: Optional[datetime]` The date and time the destination address was last modified. - `tag: Optional[str]` Destination address tag. (Deprecated, replaced by destination address identifier) - `verified: Optional[datetime]` The date and time the destination address has been verified. Null means not verified yet.