---
title: Prefixes
---

[Skip to content](#%5Ftop) 

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

[Addressing](https://developers.cloudflare.com/api/typescript/resources/addressing)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Prefixes

##### [List Prefixes](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/list)

client.addressing.prefixes.list(PrefixListParams { account\_id } params, RequestOptionsoptions?): SinglePage<[Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%20%3E%20%28schema%29) { id, account\_id, advertised, 15 more } \>

GET/accounts/{account\_id}/addressing/prefixes

##### [Prefix Details](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/get)

client.addressing.prefixes.get(stringprefixID, PrefixGetParams { account\_id } params, RequestOptionsoptions?): [Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%20%3E%20%28schema%29) { id, account\_id, advertised, 15 more } 

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}

##### [Add Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/create)

client.addressing.prefixes.create(PrefixCreateParams { account\_id, asn, cidr, 3 more } params, RequestOptionsoptions?): [Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%20%3E%20%28schema%29) { id, account\_id, advertised, 15 more } 

POST/accounts/{account\_id}/addressing/prefixes

##### [Update Prefix Description](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/edit)

client.addressing.prefixes.edit(stringprefixID, PrefixEditParams { account\_id, description } params, RequestOptionsoptions?): [Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%20%3E%20%28schema%29) { id, account\_id, advertised, 15 more } 

PATCH/accounts/{account\_id}/addressing/prefixes/{prefix\_id}

##### [Delete Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/delete)

client.addressing.prefixes.delete(stringprefixID, PrefixDeleteParams { account\_id } params, RequestOptionsoptions?): [PrefixDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%5Fdelete%5Fresponse%20%3E%20%28schema%29) { errors, messages, success } 

DELETE/accounts/{account\_id}/addressing/prefixes/{prefix\_id}

##### [Validate Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/methods/validate)

client.addressing.prefixes.validate(stringprefixID, PrefixValidateParams { account\_id } params, RequestOptionsoptions?): [Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes%20%3E%20%28model%29%20prefix%20%3E%20%28schema%29) { id, account\_id, advertised, 15 more } 

POST/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/validate

##### ModelsExpand Collapse 

Prefix { id, account\_id, advertised, 15 more } 

id?: string

Identifier of an IP Prefix.

maxLength32

account\_id?: string

Identifier of a Cloudflare account.

maxLength32

Deprecatedadvertised?: boolean | null

Prefer the [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/) instead, which allows for advertising multiple BGP routes within a single IP Prefix.

Prefix advertisement status to the Internet. This field is only not ‘null’ if on demand is enabled.

Deprecatedadvertised\_modified\_at?: string | null

Prefer the [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/) instead, which allows for advertising multiple BGP routes within a single IP Prefix.

Last time the advertisement status was changed. This field is only not ‘null’ if on demand is enabled.

formatdate-time

approved?: string

Approval state of the prefix (P = pending, V = active).

asn?: number

Autonomous System Number (ASN) the prefix will be advertised under.

cidr?: string

IP Prefix in Classless Inter-Domain Routing format.

created\_at?: string

formatdate-time

delegate\_loa\_creation?: boolean

Whether Cloudflare is allowed to generate the LOA document on behalf of the prefix owner.

description?: string

Description of the prefix.

maxLength1000

irr\_validation\_state?: string

State of one kind of validation for an IP prefix.

loa\_document\_id?: string | null

Identifier for the uploaded LOA document.

maxLength32

modified\_at?: string

formatdate-time

Deprecatedon\_demand\_enabled?: boolean

Prefer the [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/) instead, which allows for advertising multiple BGP routes within a single IP Prefix.

Whether advertisement of the prefix to the Internet may be dynamically enabled or disabled.

Deprecatedon\_demand\_locked?: boolean

Prefer the [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/) instead, which allows for advertising multiple BGP routes within a single IP Prefix.

Whether advertisement status of the prefix is locked, meaning it cannot be changed.

ownership\_validation\_state?: string

State of one kind of validation for an IP prefix.

ownership\_validation\_token?: string

Token provided to demonstrate ownership of the prefix.

rpki\_validation\_state?: string

State of one kind of validation for an IP prefix.

PrefixDeleteResponse { errors, messages, success } 

errors: Array<Error\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

messages: Array<Message\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

success: true

Whether the API call was successful.

#### PrefixesService Bindings

##### [List Service Bindings](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/service%5Fbindings/methods/list)

client.addressing.prefixes.serviceBindings.list(stringprefixID, ServiceBindingListParams { account\_id } params, RequestOptionsoptions?): SinglePage<[ServiceBinding](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.service%5Fbindings%20%3E%20%28model%29%20service%5Fbinding%20%3E%20%28schema%29) { id, cidr, provisioning, 2 more } \>

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bindings

##### [Get Service Binding](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/service%5Fbindings/methods/get)

client.addressing.prefixes.serviceBindings.get(stringbindingID, ServiceBindingGetParams { account\_id, prefix\_id } params, RequestOptionsoptions?): [ServiceBinding](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.service%5Fbindings%20%3E%20%28model%29%20service%5Fbinding%20%3E%20%28schema%29) { id, cidr, provisioning, 2 more } 

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bindings/{binding\_id}

##### [Create Service Binding](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/service%5Fbindings/methods/create)

client.addressing.prefixes.serviceBindings.create(stringprefixID, ServiceBindingCreateParams { account\_id, cidr, service\_id } params, RequestOptionsoptions?): [ServiceBinding](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.service%5Fbindings%20%3E%20%28model%29%20service%5Fbinding%20%3E%20%28schema%29) { id, cidr, provisioning, 2 more } 

POST/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bindings

##### [Delete Service Binding](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/service%5Fbindings/methods/delete)

client.addressing.prefixes.serviceBindings.delete(stringbindingID, ServiceBindingDeleteParams { account\_id, prefix\_id } params, RequestOptionsoptions?): [ServiceBindingDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.service%5Fbindings%20%3E%20%28model%29%20service%5Fbinding%5Fdelete%5Fresponse%20%3E%20%28schema%29) { errors, messages, success } 

DELETE/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bindings/{binding\_id}

##### ModelsExpand Collapse 

ServiceBinding { id, cidr, provisioning, 2 more } 

id?: string

Identifier of a Service Binding.

maxLength32

cidr?: string

IP Prefix in Classless Inter-Domain Routing format.

provisioning?: Provisioning { state } 

Status of a Service Binding’s deployment to the Cloudflare network

state?: "provisioning" | "active"

When a binding has been deployed to a majority of Cloudflare datacenters, the binding will become active and can be used with its associated service.

One of the following:

"provisioning"

"active"

service\_id?: string

Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the **List Services** endpoint.

maxLength32

service\_name?: string

Name of a service running on the Cloudflare network

ServiceBindingDeleteResponse { errors, messages, success } 

errors: Array<Error\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

messages: Array<Message\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

success: true

Whether the API call was successful.

#### PrefixesBGP Prefixes

##### [List BGP Prefixes](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/methods/list)

client.addressing.prefixes.bgpPrefixes.list(stringprefixID, BGPPrefixListParams { account\_id } params, RequestOptionsoptions?): SinglePage<[BGPPrefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.bgp%5Fprefixes%20%3E%20%28model%29%20bgp%5Fprefix%20%3E%20%28schema%29) { id, asn, asn\_prepend\_count, 6 more } \>

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/prefixes

##### [Fetch BGP Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/methods/get)

client.addressing.prefixes.bgpPrefixes.get(stringbgpPrefixID, BGPPrefixGetParams { account\_id, prefix\_id } params, RequestOptionsoptions?): [BGPPrefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.bgp%5Fprefixes%20%3E%20%28model%29%20bgp%5Fprefix%20%3E%20%28schema%29) { id, asn, asn\_prepend\_count, 6 more } 

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/prefixes/{bgp\_prefix\_id}

##### [Create BGP Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/methods/create)

client.addressing.prefixes.bgpPrefixes.create(stringprefixID, BGPPrefixCreateParams { account\_id, cidr } params, RequestOptionsoptions?): [BGPPrefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.bgp%5Fprefixes%20%3E%20%28model%29%20bgp%5Fprefix%20%3E%20%28schema%29) { id, asn, asn\_prepend\_count, 6 more } 

POST/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/prefixes

##### [Update BGP Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/methods/edit)

client.addressing.prefixes.bgpPrefixes.edit(stringbgpPrefixID, BGPPrefixEditParams { account\_id, prefix\_id, asn\_prepend\_count, 2 more } params, RequestOptionsoptions?): [BGPPrefix](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.bgp%5Fprefixes%20%3E%20%28model%29%20bgp%5Fprefix%20%3E%20%28schema%29) { id, asn, asn\_prepend\_count, 6 more } 

PATCH/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/prefixes/{bgp\_prefix\_id}

##### [Delete BGP Prefix](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/bgp%5Fprefixes/methods/delete)

client.addressing.prefixes.bgpPrefixes.delete(stringbgpPrefixID, BGPPrefixDeleteParams { account\_id, prefix\_id } params, RequestOptionsoptions?): [BGPPrefixDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.bgp%5Fprefixes%20%3E%20%28model%29%20bgp%5Fprefix%5Fdelete%5Fresponse%20%3E%20%28schema%29) { errors, messages, success } 

DELETE/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/prefixes/{bgp\_prefix\_id}

##### ModelsExpand Collapse 

BGPPrefix { id, asn, asn\_prepend\_count, 6 more } 

id?: string

Identifier of BGP Prefix.

maxLength32

asn?: number | null

Autonomous System Number (ASN) the prefix will be advertised under.

asn\_prepend\_count?: number

Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute

maximum3

minimum0

auto\_advertise\_withdraw?: boolean

Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no matching BGP prefix in the Magic routing table. When true, Cloudflare will automatically withdraw the BGP prefix when there are no matching BGP routes, and will resume advertising when there is at least one matching BGP route.

bgp\_signal\_opts?: BGPSignalOpts { enabled, modified\_at } 

enabled?: boolean

Whether control of advertisement of the prefix to the Internet is enabled to be performed via BGP signal

modified\_at?: string | null

Last time BGP signaling control was toggled. This field is null if BGP signaling has never been enabled.

formatdate-time

cidr?: string

IP Prefix in Classless Inter-Domain Routing format.

created\_at?: string

formatdate-time

modified\_at?: string

formatdate-time

on\_demand?: OnDemand { advertised, advertised\_modified\_at, on\_demand\_enabled, on\_demand\_locked } 

advertised?: boolean | null

Prefix advertisement status to the Internet. This field is only not ‘null’ if on demand is enabled.

advertised\_modified\_at?: string | null

Last time the advertisement status was changed. This field is only not ‘null’ if on demand is enabled.

formatdate-time

on\_demand\_enabled?: boolean

Whether advertisement of the prefix to the Internet may be dynamically enabled or disabled.

on\_demand\_locked?: boolean

Whether the advertisement status of the prefix is locked, meaning it cannot be changed.

BGPPrefixDeleteResponse { errors, messages, success } 

errors: Array<Error\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

messages: Array<Message\>

code: number

minimum1000

message: string

documentation\_url?: string

source?: Source { pointer } 

pointer?: string

success: true

Whether the API call was successful.

#### PrefixesAdvertisement Status

##### [Get Advertisement Status](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/advertisement%5Fstatus/methods/get)

Deprecated

client.addressing.prefixes.advertisementStatus.get(stringprefixID, AdvertisementStatusGetParams { account\_id } params, RequestOptionsoptions?): [AdvertisementStatusGetResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.advertisement%5Fstatus%20%3E%20%28model%29%20advertisement%5Fstatus%5Fget%5Fresponse%20%3E%20%28schema%29) { advertised, advertised\_modified\_at } 

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/status

##### [Update Prefix Dynamic Advertisement Status](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/advertisement%5Fstatus/methods/edit)

Deprecated

client.addressing.prefixes.advertisementStatus.edit(stringprefixID, AdvertisementStatusEditParams { account\_id, advertised } params, RequestOptionsoptions?): [AdvertisementStatusEditResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.advertisement%5Fstatus%20%3E%20%28model%29%20advertisement%5Fstatus%5Fedit%5Fresponse%20%3E%20%28schema%29) { advertised, advertised\_modified\_at } 

PATCH/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/bgp/status

##### ModelsExpand Collapse 

AdvertisementStatusGetResponse { advertised, advertised\_modified\_at } 

advertised?: boolean

Advertisement status of the prefix. If `true`, the BGP route for the prefix is advertised to the Internet. If `false`, the BGP route is withdrawn.

advertised\_modified\_at?: string | null

Last time the advertisement status was changed. This field is only not ‘null’ if on demand is enabled.

formatdate-time

AdvertisementStatusEditResponse { advertised, advertised\_modified\_at } 

advertised?: boolean

Advertisement status of the prefix. If `true`, the BGP route for the prefix is advertised to the Internet. If `false`, the BGP route is withdrawn.

advertised\_modified\_at?: string | null

Last time the advertisement status was changed. This field is only not ‘null’ if on demand is enabled.

formatdate-time

#### PrefixesDelegations

##### [List Prefix Delegations](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/delegations/methods/list)

client.addressing.prefixes.delegations.list(stringprefixID, DelegationListParams { account\_id } params, RequestOptionsoptions?): SinglePage<[Delegations](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.delegations%20%3E%20%28model%29%20delegations%20%3E%20%28schema%29) { id, cidr, created\_at, 3 more } \>

GET/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/delegations

##### [Create Prefix Delegation](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/delegations/methods/create)

client.addressing.prefixes.delegations.create(stringprefixID, DelegationCreateParams { account\_id, cidr, delegated\_account\_id } params, RequestOptionsoptions?): [Delegations](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.delegations%20%3E%20%28model%29%20delegations%20%3E%20%28schema%29) { id, cidr, created\_at, 3 more } 

POST/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/delegations

##### [Delete Prefix Delegation](https://developers.cloudflare.com/api/typescript/resources/addressing/subresources/prefixes/subresources/delegations/methods/delete)

client.addressing.prefixes.delegations.delete(stringdelegationID, DelegationDeleteParams { account\_id, prefix\_id } params, RequestOptionsoptions?): [DelegationDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/addressing#%28resource%29%20addressing.prefixes.delegations%20%3E%20%28model%29%20delegation%5Fdelete%5Fresponse%20%3E%20%28schema%29) { id } 

DELETE/accounts/{account\_id}/addressing/prefixes/{prefix\_id}/delegations/{delegation\_id}

##### ModelsExpand Collapse 

Delegations { id, cidr, created\_at, 3 more } 

id?: string

Identifier of a Delegation.

maxLength32

cidr?: string

IP Prefix in Classless Inter-Domain Routing format.

created\_at?: string

formatdate-time

delegated\_account\_id?: string

Account identifier for the account to which prefix is being delegated.

maxLength32

modified\_at?: string

formatdate-time

parent\_prefix\_id?: string

Identifier of an IP Prefix.

maxLength32

DelegationDeleteResponse { id } 

id?: string

Identifier of a Delegation.

maxLength32