Skip to content
Start here

List destination addresses

client.EmailRouting.Addresses.List(ctx, params) (*V4PagePaginationArray[Address], error)
GET/accounts/{account_id}/email/routing/addresses

Lists destination addresses configured for Email Routing in an account.

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
Accepted Permissions (at least one required)
Email Routing Addresses WriteEmail Routing Addresses Read
ParametersExpand Collapse
params AddressListParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
Direction param.Field[AddressListParamsDirection]Optional

Query param: Sorts results in an ascending or descending order.

const AddressListParamsDirectionAsc AddressListParamsDirection = "asc"
const AddressListParamsDirectionDesc AddressListParamsDirection = "desc"
Page param.Field[float64]Optional

Query param: Page number of paginated results.

minimum1
PerPage param.Field[float64]Optional

Query param: Maximum number of results per page.

maximum50
minimum5
Verified param.Field[AddressListParamsVerified]Optional

Query param: Filter by verified destination addresses.

const AddressListParamsVerifiedTrue AddressListParamsVerified = true
const AddressListParamsVerifiedFalse AddressListParamsVerified = false
ReturnsExpand Collapse
type Address struct{…}
ID stringOptional

Destination address identifier.

maxLength32
Created TimeOptional

The date and time the destination address has been created.

formatdate-time
Email stringOptional

The contact email address of the user.

maxLength90
Modified TimeOptional

The date and time the destination address was last modified.

formatdate-time
DeprecatedTag stringOptional

Destination address tag. (Deprecated, replaced by destination address identifier)

maxLength32
Verified TimeOptional

The date and time the destination address has been verified. Null means not verified yet.

formatdate-time

List destination addresses

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.EmailRouting.Addresses.List(context.TODO(), email_routing.AddressListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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
  }
}
Returns Examples
{
  "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
  }
}