Skip to content
Start here

Prefixes

List Prefixes
addressing.prefixes.list(PrefixListParams**kwargs) -> SyncSinglePage[Prefix]
GET/accounts/{account_id}/addressing/prefixes
Prefix Details
addressing.prefixes.get(strprefix_id, PrefixGetParams**kwargs) -> Prefix
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}
Add Prefix
addressing.prefixes.create(PrefixCreateParams**kwargs) -> Prefix
POST/accounts/{account_id}/addressing/prefixes
Update Prefix Description
addressing.prefixes.edit(strprefix_id, PrefixEditParams**kwargs) -> Prefix
PATCH/accounts/{account_id}/addressing/prefixes/{prefix_id}
Delete Prefix
addressing.prefixes.delete(strprefix_id, PrefixDeleteParams**kwargs) -> PrefixDeleteResponse
DELETE/accounts/{account_id}/addressing/prefixes/{prefix_id}
ModelsExpand Collapse
class Prefix:
id: Optional[str]

Identifier of an IP Prefix.

maxLength32
account_id: Optional[str]

Identifier of a Cloudflare account.

maxLength32
Deprecatedadvertised: Optional[bool]
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: Optional[datetime]
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: Optional[str]

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

asn: Optional[int]

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

cidr: Optional[str]

IP Prefix in Classless Inter-Domain Routing format.

created_at: Optional[datetime]
formatdate-time
delegate_loa_creation: Optional[bool]

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

description: Optional[str]

Description of the prefix.

maxLength1000
irr_validation_state: Optional[str]

State of one kind of validation for an IP prefix.

loa_document_id: Optional[str]

Identifier for the uploaded LOA document.

maxLength32
modified_at: Optional[datetime]
formatdate-time
Deprecatedon_demand_enabled: Optional[bool]
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: Optional[bool]
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: Optional[str]

State of one kind of validation for an IP prefix.

ownership_validation_token: Optional[str]

Token provided to demonstrate ownership of the prefix.

rpki_validation_state: Optional[str]

State of one kind of validation for an IP prefix.

class PrefixDeleteResponse:
errors: List[Error]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[ErrorSource]
pointer: Optional[str]
messages: List[Message]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[MessageSource]
pointer: Optional[str]
success: Literal[true]

Whether the API call was successful.

PrefixesService Bindings

List Service Bindings
addressing.prefixes.service_bindings.list(strprefix_id, ServiceBindingListParams**kwargs) -> SyncSinglePage[ServiceBinding]
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings
Get Service Binding
addressing.prefixes.service_bindings.get(strbinding_id, ServiceBindingGetParams**kwargs) -> ServiceBinding
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}
Create Service Binding
addressing.prefixes.service_bindings.create(strprefix_id, ServiceBindingCreateParams**kwargs) -> ServiceBinding
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings
Delete Service Binding
addressing.prefixes.service_bindings.delete(strbinding_id, ServiceBindingDeleteParams**kwargs) -> ServiceBindingDeleteResponse
DELETE/accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}
ModelsExpand Collapse
class ServiceBinding:
id: Optional[str]

Identifier of a Service Binding.

maxLength32
cidr: Optional[str]

IP Prefix in Classless Inter-Domain Routing format.

provisioning: Optional[Provisioning]

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

state: Optional[Literal["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: Optional[str]

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

maxLength32
service_name: Optional[str]

Name of a service running on the Cloudflare network

class ServiceBindingDeleteResponse:
errors: List[Error]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[ErrorSource]
pointer: Optional[str]
messages: List[Message]
code: int
minimum1000
message: str
documentation_url: Optional[str]
source: Optional[MessageSource]
pointer: Optional[str]
success: Literal[true]

Whether the API call was successful.

PrefixesBGP Prefixes

List BGP Prefixes
addressing.prefixes.bgp_prefixes.list(strprefix_id, BGPPrefixListParams**kwargs) -> SyncSinglePage[BGPPrefix]
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes
Fetch BGP Prefix
addressing.prefixes.bgp_prefixes.get(strbgp_prefix_id, BGPPrefixGetParams**kwargs) -> BGPPrefix
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}
Create BGP Prefix
addressing.prefixes.bgp_prefixes.create(strprefix_id, BGPPrefixCreateParams**kwargs) -> BGPPrefix
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes
Update BGP Prefix
addressing.prefixes.bgp_prefixes.edit(strbgp_prefix_id, BGPPrefixEditParams**kwargs) -> BGPPrefix
PATCH/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/prefixes/{bgp_prefix_id}
ModelsExpand Collapse
class BGPPrefix:
id: Optional[str]

Identifier of BGP Prefix.

maxLength32
asn: Optional[int]

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

asn_prepend_count: Optional[int]

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

maximum3
minimum0
auto_advertise_withdraw: Optional[bool]

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: Optional[BGPSignalOpts]
enabled: Optional[bool]

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

modified_at: Optional[datetime]

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

formatdate-time
cidr: Optional[str]

IP Prefix in Classless Inter-Domain Routing format.

created_at: Optional[datetime]
formatdate-time
modified_at: Optional[datetime]
formatdate-time
on_demand: Optional[OnDemand]
advertised: Optional[bool]

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

advertised_modified_at: Optional[datetime]

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

formatdate-time
on_demand_enabled: Optional[bool]

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

on_demand_locked: Optional[bool]

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

PrefixesAdvertisement Status

Get Advertisement Status
Deprecated
addressing.prefixes.advertisement_status.get(strprefix_id, AdvertisementStatusGetParams**kwargs) -> AdvertisementStatusGetResponse
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status
Update Prefix Dynamic Advertisement Status
Deprecated
addressing.prefixes.advertisement_status.edit(strprefix_id, AdvertisementStatusEditParams**kwargs) -> AdvertisementStatusEditResponse
PATCH/accounts/{account_id}/addressing/prefixes/{prefix_id}/bgp/status
ModelsExpand Collapse

PrefixesDelegations

List Prefix Delegations
addressing.prefixes.delegations.list(strprefix_id, DelegationListParams**kwargs) -> SyncSinglePage[Delegations]
GET/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations
Create Prefix Delegation
addressing.prefixes.delegations.create(strprefix_id, DelegationCreateParams**kwargs) -> Delegations
POST/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations
Delete Prefix Delegation
addressing.prefixes.delegations.delete(strdelegation_id, DelegationDeleteParams**kwargs) -> DelegationDeleteResponse
DELETE/accounts/{account_id}/addressing/prefixes/{prefix_id}/delegations/{delegation_id}
ModelsExpand Collapse
class Delegations:
id: Optional[str]

Identifier of a Delegation.

maxLength32
cidr: Optional[str]

IP Prefix in Classless Inter-Domain Routing format.

created_at: Optional[datetime]
formatdate-time
delegated_account_id: Optional[str]

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

maxLength32
modified_at: Optional[datetime]
formatdate-time
parent_prefix_id: Optional[str]

Identifier of an IP Prefix.

maxLength32
class DelegationDeleteResponse:
id: Optional[str]

Identifier of a Delegation.

maxLength32