---
title: Create a DLS prefix binding
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Data Localization Suite](https://developers.cloudflare.com/api/typescript/resources/dls)

[Regional Services](https://developers.cloudflare.com/api/typescript/resources/dls/subresources/regional_services)

[Prefix Bindings](https://developers.cloudflare.com/api/typescript/resources/dls/subresources/regional_services/subresources/prefix_bindings)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Create a DLS prefix binding

client.dls.regionalServices.prefixBindings.create(PrefixBindingCreateParams {account\_id, cidr, prefix\_id, region\_key } params, RequestOptionsoptions?): [PrefixBindingCreateResponse](<https://developers.cloudflare.com/api/typescript/resources/dls#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)>) {id, cidr, prefix\_id, region\_key }

POST/accounts/{account\_id}/dls/regional\_services/prefix\_bindings

Create a DLS prefix binding

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### ParametersExpand Collapse

<details>

<summary>

params: PrefixBindingCreateParams {account\_id, cidr, prefix\_id, region\_key }

</summary>

account\_id: string

Path param: Identifier of a Cloudflare account.

maxLength32

minLength32

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

cidr: string

Body param: IP prefix in CIDR notation to bind.

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20cidr">Link to this property</a>

prefix\_id: string

Body param: The ID of the parent IP prefix that contains the CIDR.

maxLength64

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20prefix_id">Link to this property</a>

region\_key: string

Body param: Region key from managed regions (e.g., “us”, “eu”).

maxLength128

minLength1

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20region_key">Link to this property</a>

</details>

[Link to this property](<#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(method)%20create%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

PrefixBindingCreateResponse {id, cidr, prefix\_id, region\_key }

</summary>

id: string

The ID of the binding.

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

cidr: string

The CIDR that is bound.

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)%20%3E%20(property)%20cidr">Link to this property</a>

prefix\_id: string

The ID of the parent prefix.

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)%20%3E%20(property)%20prefix_id">Link to this property</a>

region\_key: string

The region key used for the binding.

maxLength128

minLength1

<a href="#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)%20%3E%20(property)%20region_key">Link to this property</a>

</details>

[Link to this property](<#(resource)%20dls.regional_services.prefix_bindings%20%3E%20(model)%20prefix_binding_create_response%20%3E%20(schema)>)

### Create a DLS prefix binding

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

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

const prefixBinding = await client.dls.regionalServices.prefixBindings.create({
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  cidr: '10.0.1.0/24',
  prefix_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
  region_key: 'eu',
});

console.log(prefixBinding.id);
```

200 example

```
{
  "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

200 example

```
{
  "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"
      }
    }
  ]
}
```