Skip to content
Start here

Select region

client.ZeroTrust.Regions.Update(ctx, params) (*ActiveAccountRegion, error)
PUT/accounts/{account_id}/zerotrust/region

Selects the region that the account uses for Cloudflare One. The region must be one of the account’s available regions. Selecting the active region again has no effect.

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
ParametersExpand Collapse
params RegionUpdateParams
AccountID param.Field[string]

Path param: Cloudflare account ID

maxLength32
RegionKey param.Field[string]

Body param: The key of a Data Localization Suite region.

minLength1
ReturnsExpand Collapse
type ActiveAccountRegion struct{…}
RegionKey string

The key of the account’s active Data Localization Suite region, or null if the account has not selected a region.

minLength1

Select region

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  activeAccountRegion, err := client.ZeroTrust.Regions.Update(context.TODO(), zero_trust.RegionUpdateParams{
    AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
    RegionKey: cloudflare.F("eu"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", activeAccountRegion.RegionKey)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "context": {
        "foo": "bar"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "context": {
        "foo": "bar"
      }
    }
  ],
  "result": {
    "region_key": "eu"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "context": {
        "foo": "bar"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "context": {
        "foo": "bar"
      }
    }
  ],
  "result": {
    "region_key": "eu"
  },
  "success": true
}