cloudflare/cloudflare-python v5.0.0-beta.2
cloudflare/cloudflare-python
Captured source
source ↗v5.0.0-beta.2
Repository: cloudflare/cloudflare-python
Tag: v5.0.0-beta.2
Published: 2026-04-20T23:11:42Z
Prerelease: yes
Release notes:
v5.0.0-beta.2
> This is a beta release. The API surface may change before the stable release.
Full diff: `v5.0.0-beta.1...v5.0.0-beta.2`
This release adds 163 new methods across 4 new top-level resources and numerous sub-resource expansions, restructures the api.md surface into per-resource files, and includes codegen updates across all existing resources.
General Changes
Client-level account_id and zone_id configuration
You can now set account_id and zone_id once on the client instead of passing them to every method call. When set, these values are used as defaults for all methods that accept them. You can still override per-call by passing the parameter explicitly.
from cloudflare import Cloudflare # Set account_id once at the client level client = Cloudflare(account_id="my-account-id") # No need to pass account_id on every call workers = client.workers.scripts.list() rules = client.rules.lists.list()
Both options also read from environment variables:
account_idfromCLOUDFLARE_ACCOUNT_IDzone_idfromCLOUDFLARE_ZONE_ID
# Or configure via environment variables # export CLOUDFLARE_ACCOUNT_ID=my-account-id # export CLOUDFLARE_ZONE_ID=my-zone-id client = Cloudflare()
All methods that previously required account_id or zone_id as a positional/keyword argument now accept None as a default and fall back to the client-level value. If neither is set, a ValueError is raised with a clear message.
Breaking Changes
Restructured Resources
- AISearch:
aisearch.instances.items(get,list) has been replaced by the new
namespace-based architecture under aisearch.namespaces.instances.items (see New Resources below)
- Registrar:
registrar.domains(get,list,update) has been replaced by
registrar.registrations with expanded functionality including create, edit, get, list, plus new registrar.check, registrar.search, registrar.registration_status.get, and registrar.update_status.get methods
Removed Methods
cloudforce_one.threat_events.delete
New API Resources
Top-Level Resources
- VulnerabilityScanner -- Full CRUD for vulnerability scanning
credential_sets--create,delete,edit,get,list,updatecredential_sets.credentials--create,delete,edit,get,list,updatescans--create,get,listtarget_environments--create,delete,edit,get,list,update
- GoogleTagGateway -- Google Tag Gateway configuration
config--get,update
- EmailSending -- Email sending with subdomain management
send,send_rawsubdomains--create,delete,get,listsubdomains.dns--get
- ResourceTagging -- Resource tagging and key/value management
listaccount_tags--delete,get,updatezone_tags--delete,get,updatekeys--listvalues--list
New Sub-Resources on Existing Resources
- AISearch (restructured) -- Expanded namespace-based architecture
aisearch.namespaces--create,delete,list,read,search,update,
chat_completions
aisearch.namespaces.instances--create,list,read,search,stats,update,
chat_completions
aisearch.namespaces.instances.items--chunks,create_or_update,delete,download,
get, list, logs, sync, upload
aisearch.namespaces.instances.jobs--create,get,list,logs,update
- APIGateway Labels -- Label management for API Gateway operations
api_gateway.labels--listapi_gateway.labels.managed--getapi_gateway.labels.managed.resources.operation--updateapi_gateway.labels.user--bulk_create,bulk_delete,delete,edit,get,updateapi_gateway.labels.user.resources.operation--updateapi_gateway.operations.labels--bulk_create,bulk_delete,bulk_update,create,
delete, update
- BrowserRendering -- DevTools and crawl APIs
browser_rendering.crawl--create,delete,getbrowser_rendering.devtools.browser--connect,create,delete,launch,protocol,
version
browser_rendering.devtools.browser.page--getbrowser_rendering.devtools.browser.targets--activate,create,get,listbrowser_rendering.devtools.session--get,list
- Custom Pages Assets -- Custom page asset management
custom_pages.assets--create,delete,get,list,update
- ACM Custom Trust Store -- Custom origin trust store
acm.custom_trust_store--create,delete,get,list
- Workers Observability Destinations -- Log destinations for Workers observability
workers.observability.destinations--create,delete,list,update
- Registrar (expanded) -- Domain registration with full lifecycle management
registrar.registrations--create,edit,get,listregistrar.check,registrar.searchregistrar.registration_status--getregistrar.update_status--get
- Zero Trust additions
zero_trust.access.users--create,delete,get,updatezero_trust.devices.ip_profiles--create,delete,get,list,updatezero_trust.dex.rules--create,delete,get,list,updatezero_trust.dlp.settings--delete,edit,get,updatezero_trust.gateway.pacfiles--create,delete,get,list,updatezero_trust.networks.subnets.warp--create,delete,edit,getzero_trust.tunnels.warp_connector.connections--getzero_trust.tunnels.warp_connector.connectors--getzero_trust.tunnels.warp_connector.failover--update
- Zones Environments -- Zone environment management
zones.environments--create,delete,edit,list,rollback,update
- Radar additions
radar.agent_readiness--summaryradar.ai.markdown_for_agents--summary,timeseriesradar.entities.asns--botnet_threat_feedradar.post_quantum.origin--summary,timeseries_groupsradar.post_quantum.tls--support
- Billing Usage -- PayGo billing usage
billing.usage--paygo
- Email Security -- PhishGuard reporting
-…
Excerpt shown — open the source for the full document.
Notability
notability 3.0/10Routine SDK beta release, low AI relevance