Skip to content
Start here

Update destination address

client.EmailRouting.Addresses.Edit(ctx, destinationAddressIdentifier, params) (*Address, error)
PATCH/accounts/{account_id}/email/routing/addresses/{destination_address_identifier}

Updates the status of a specific destination address.

Security

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 Write
ParametersExpand Collapse
destinationAddressIdentifier string

Destination address identifier.

maxLength32
params AddressEditParams
AccountID param.Field[string]

Path param: Identifier.

maxLength32
Status param.Field[AddressEditParamsStatus]

Body param: Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.

const AddressEditParamsStatusUnverified AddressEditParamsStatus = "unverified"
const AddressEditParamsStatusVerified AddressEditParamsStatus = "verified"
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

Update destination address

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  address, err := client.EmailRouting.Addresses.Edit(
    context.TODO(),
    "ea95132c15732412d22c1476fa83f27a",
    email_routing.AddressEditParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      Status: cloudflare.F(email_routing.AddressEditParamsStatusVerified),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", address.ID)
}
{
  "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"
  }
}
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"
  }
}