Skip to content
Start here

Prefixes

List Prefixes
client.addressing.prefixes.list(PrefixListParams { account_id } params, RequestOptionsoptions?): SinglePage<Prefix { id, account_id, advertised, 15 more } >
GET/accounts/{account_id}/addressing/prefixes
Prefix Details
client.addressing.prefixes.get(stringprefixId, PrefixGetParams { account_id } params, RequestOptionsoptions?): Prefix { id, account_id, advertised, 15 more }
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}
Add Prefix
client.addressing.prefixes.create(PrefixCreateParams { account_id, asn, cidr, 3 more } params, RequestOptionsoptions?): Prefix { id, account_id, advertised, 15 more }
POST/accounts/{account_id}/addressing/prefixes
Update Prefix Description
client.addressing.prefixes.edit(stringprefixId, PrefixEditParams { account_id, description } params, RequestOptionsoptions?): Prefix { id, account_id, advertised, 15 more }
PATCH/accounts/{account_id}/addressing/prefixes/{prefix_id}
Delete Prefix
client.addressing.prefixes.delete(stringprefixId, PrefixDeleteParams { account_id } params, RequestOptionsoptions?): PrefixDeleteResponse { errors, messages, success }
DELETE/accounts/{account_id}/addressing/prefixes/{prefix_id}
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_prefixes/) 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_prefixes/) 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_prefixes/) 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_prefixes/) 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
client.addressing.prefixes.serviceBindings.list(stringprefixId, ServiceBindingListParams { account_id } params, RequestOptionsoptions?): SinglePage<ServiceBinding { id, cidr, provisioning, 2 more } >
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings
Get Service Binding
client.addressing.prefixes.serviceBindings.get(stringprefixId, stringbindingId, ServiceBindingGetParams { account_id } params, RequestOptionsoptions?): ServiceBinding { id, cidr, provisioning, 2 more }
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}
Create Service Binding
client.addressing.prefixes.serviceBindings.create(stringprefixId, ServiceBindingCreateParams { account_id, cidr, service_id } params, RequestOptionsoptions?): ServiceBinding { id, cidr, provisioning, 2 more }
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings
Delete Service Binding
client.addressing.prefixes.serviceBindings.delete(stringprefixId, stringbindingId, ServiceBindingDeleteParams { account_id } params, RequestOptionsoptions?): ServiceBindingDeleteResponse { 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
client.addressing.prefixes.bgpPrefixes.list(stringprefixId, BGPPrefixListParams { account_id } params, RequestOptionsoptions?): SinglePage<BGPPrefix { id, asn, asn_prepend_count, 6 more } >
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes
Fetch BGP Prefix
client.addressing.prefixes.bgpPrefixes.get(stringprefixId, stringbgpPrefixId, BGPPrefixGetParams { account_id } params, RequestOptionsoptions?): BGPPrefix { id, asn, asn_prepend_count, 6 more }
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}
Create BGP Prefix
client.addressing.prefixes.bgpPrefixes.create(stringprefixId, BGPPrefixCreateParams { account_id, cidr } params, RequestOptionsoptions?): BGPPrefix { id, asn, asn_prepend_count, 6 more }
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes
Update BGP Prefix
client.addressing.prefixes.bgpPrefixes.edit(stringprefixId, stringbgpPrefixId, BGPPrefixEditParams { account_id, asn_prepend_count, auto_advertise_withdraw, on_demand } params, RequestOptionsoptions?): BGPPrefix { id, asn, asn_prepend_count, 6 more }
PATCH/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.

PrefixesAdvertisement Status

Get Advertisement Status
Deprecated
client.addressing.prefixes.advertisementStatus.get(stringprefixId, AdvertisementStatusGetParams { account_id } params, RequestOptionsoptions?): AdvertisementStatusGetResponse { advertised, advertised_modified_at }
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status
Update Prefix Dynamic Advertisement Status
Deprecated
client.addressing.prefixes.advertisementStatus.edit(stringprefixId, AdvertisementStatusEditParams { account_id, advertised } params, RequestOptionsoptions?): AdvertisementStatusEditResponse { advertised, advertised_modified_at }
PATCH/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status
ModelsExpand Collapse

PrefixesDelegations

List Prefix Delegations
client.addressing.prefixes.delegations.list(stringprefixId, DelegationListParams { account_id } params, RequestOptionsoptions?): SinglePage<Delegations { id, cidr, created_at, 3 more } >
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations
Create Prefix Delegation
client.addressing.prefixes.delegations.create(stringprefixId, DelegationCreateParams { account_id, cidr, delegated_account_id } params, RequestOptionsoptions?): Delegations { id, cidr, created_at, 3 more }
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations
Delete Prefix Delegation
client.addressing.prefixes.delegations.delete(stringprefixId, stringdelegationId, DelegationDeleteParams { account_id } params, RequestOptionsoptions?): DelegationDeleteResponse { 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