Skip to content
Start here

Update a DLS prefix binding

client.dls.regionalServices.prefixBindings.edit(stringbindingId, PrefixBindingEditParams { account_id, region_key } params, RequestOptionsoptions?): PrefixBindingEditResponse { id, cidr, prefix_id, region_key }
PATCH/accounts/{account_id}/dls/regional_services/prefix_bindings/{binding_id}

Update a DLS prefix binding

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
bindingId: string

Unique identifier for the prefix binding.

params: PrefixBindingEditParams { account_id, region_key }
account_id: string

Path param: Identifier of a Cloudflare account.

maxLength32
minLength32
region_key: string

Body param: New region key to assign (e.g., “us”, “eu”, “cfcanary”).

maxLength128
minLength1
ReturnsExpand Collapse
PrefixBindingEditResponse { id, cidr, prefix_id, region_key }
id: string

The ID of the binding.

cidr: string

The CIDR that is bound.

prefix_id: string

The ID of the parent prefix.

region_key: string

The region key used for the binding.

maxLength128
minLength1

Update a DLS prefix binding

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const response = await client.dls.regionalServices.prefixBindings.edit(
  'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353', region_key: 'eu' },
);

console.log(response.id);
{
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "id",
    "cidr": "cidr",
    "prefix_id": "prefix_id",
    "region_key": "x"
  },
  "success": true,
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ]
}
Returns Examples
{
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "id",
    "cidr": "cidr",
    "prefix_id": "prefix_id",
    "region_key": "x"
  },
  "success": true,
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ]
}