Skip to content

Releases: cloudflare/cloudflare-python

v5.0.0-beta.2

20 Apr 23:11
e351641

Choose a tag to compare

v5.0.0-beta.2 Pre-release
Pre-release

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_id from CLOUDFLARE_ACCOUNT_ID
  • zone_id from CLOUDFLARE_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, update
    • credential_sets.credentials -- create, delete, edit, get, list, update
    • scans -- create, get, list
    • target_environments -- create, delete, edit, get, list, update
  • GoogleTagGateway -- Google Tag Gateway configuration

    • config -- get, update
  • EmailSending -- Email sending with subdomain management

    • send, send_raw
    • subdomains -- create, delete, get, list
    • subdomains.dns -- get
  • ResourceTagging -- Resource tagging and key/value management

    • list
    • account_tags -- delete, get, update
    • zone_tags -- delete, get, update
    • keys -- list
    • values -- 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 -- list
    • api_gateway.labels.managed -- get
    • api_gateway.labels.managed.resources.operation -- update
    • api_gateway.labels.user -- bulk_create, bulk_delete, delete, edit, get, update
    • api_gateway.labels.user.resources.operation -- update
    • api_gateway.operations.labels -- bulk_create, bulk_delete, bulk_update, create,
      delete, update
  • BrowserRendering -- DevTools and crawl APIs

    • browser_rendering.crawl -- create, delete, get
    • browser_rendering.devtools.browser -- connect, create, delete, launch, protocol,
      version
    • browser_rendering.devtools.browser.page -- get
    • browser_rendering.devtools.browser.targets -- activate, create, get, list
    • browser_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, list
    • registrar.check, registrar.search
    • registrar.registration_status -- get
    • registrar.update_status -- get
  • Zero Trust additions

    • zero_trust.access.users -- create, delete, get, update
    • zero_trust.devices.ip_profiles -- create, delete, get, list, update
    • zero_trust.dex.rules -- create, delete, get, list, update
    • zero_trust.dlp.settings -- delete, edit, get, update
    • zero_trust.gateway.pacfiles -- create, delete, get, list, update
    • zero_trust.networks.subnets.warp -- create, delete, edit, get
    • zero_trust.tunnels.warp_connector.connections -- get
    • zero_trust.tunnels.warp_connector.connectors -- get
    • zero_trust.tunnels.warp_connector.failover -- update
  • Zones Environments -- Zone environment management

    • zones.environments -- create, delete, edit, list, rollback, update
  • Radar additions

    • radar.agent_readiness -- summary
    • radar.ai.markdown_for_agents -- summary, timeseries
    • radar.entities.asns -- botnet_threat_feed
    • radar.post_quantum.origin -- summary, timeseries_groups
    • radar.post_quantum.tls -- support
  • Billing Usage -- PayGo billing usage

    • billing.usage -- paygo
  • Email Security -- PhishGuard reporting

    • email_security.phishguard.reports -- list
  • Brand Protection -- v2 endpoints

    • brand_protection.v2 additions

Bug Fixes

  • fix(dlp): Add missing model_rebuild()/update_forward_refs() calls for
    CustomProfileSharedEntryCustomEntry and IntegrationProfileSharedEntryCustomEntry, fixing
    pydantic v1 validation errors on DLP profile types.
  • fix(workers): Make RunQueryParametersNeedleValue a BaseModel with
    arbitrary_types_allowed to prevent pydantic config errors.

Internal

  • api.md has been restructured from a single monolithic file into per-resource files under
    src/cloudflare/resources/*/api.md. The root api.md now contains shared types and links to
    each resource's documentation.
  • Codegen updates applied across all resources with updated type annotations and method signatures.

v5.0.0-beta.1

13 Feb 06:25
1ed15a7

Choose a tag to compare

v5.0.0-beta.1 Pre-release
Pre-release

5.0.0-beta.1 (2026-02-13)

Disclaimer: Please note that v5.0.0-beta.1 is in Beta and we are still testing it for stability.

Full Changelog: v4.3.1...v5.0.0-beta.1

In this release, you'll see a large number of breaking changes. This is primarily due to a change in OpenAPI definitions,
which our libraries are based off of, and codegen updates that we rely on to read those OpenAPI definitions and produce
our SDK libraries. As the codegen is always evolving and improving, so are our code bases.

There may be changes that are not captured in this changelog. Feel free to open an issue to report any inaccuracies, and we will make sure it gets into the changelog before the v5.0.0 release.

Most of the breaking changes below are caused by improvements to the accuracy of the base OpenAPI schemas, which
sometimes translates to breaking changes in downstream clients that depend on those schemas.

Please ensure you read through the list of changes below and the migration guide before moving to this version - this
will help you understand any down or upstream issues it may cause to your environments.

Breaking Changes

The following resources have breaking changes. See the v5 Migration Guide for detailed migration instructions.

  • abusereports
  • acm.totaltls
  • apigateway.configurations
  • cloudforceone.threatevents
  • d1.database
  • intel.indicatorfeeds
  • logpush.edge
  • origintlsclientauth.hostnames
  • queues.consumers
  • radar.bgp
  • rulesets.rules
  • schemavalidation.schemas
  • snippets
  • zerotrust.dlp
  • zerotrust.networks

Features

New API Resources

  • abusereports - Abuse report management
  • abusereports.mitigations - Abuse report mitigation actions
  • ai.tomarkdown - AI-powered markdown conversion
  • aigateway.dynamicrouting - AI Gateway dynamic routing configuration
  • aigateway.providerconfigs - AI Gateway provider configurations
  • aisearch - AI-powered search functionality
  • aisearch.instances - AI Search instance management
  • aisearch.tokens - AI Search authentication tokens
  • alerting.silences - Alert silence management
  • brandprotection.logomatches - Brand protection logo match detection
  • brandprotection.logos - Brand protection logo management
  • brandprotection.matches - Brand protection match results
  • brandprotection.queries - Brand protection query management
  • cloudforceone.binarystorage - CloudForce One binary storage
  • connectivity.directory - Connectivity directory services
  • d1.database - D1 database management
  • diagnostics.endpointhealthchecks - Endpoint health check diagnostics
  • fraud - Fraud detection and prevention
  • iam.sso - IAM Single Sign-On configuration
  • loadbalancers.monitorgroups - Load balancer monitor groups
  • organizations - Organization management
  • organizations.organizationprofile - Organization profile settings
  • origintlsclientauth.hostnamecertificates - Origin TLS client auth hostname certificates
  • origintlsclientauth.hostnames - Origin TLS client auth hostnames
  • origintlsclientauth.zonecertificates - Origin TLS client auth zone certificates
  • pipelines - Data pipeline management
  • pipelines.sinks - Pipeline sink configurations
  • pipelines.streams - Pipeline stream configurations
  • queues.subscriptions - Queue subscription management
  • r2datacatalog - R2 Data Catalog integration
  • r2datacatalog.credentials - R2 Data Catalog credentials
  • r2datacatalog.maintenanceconfigs - R2 Data Catalog maintenance configurations
  • r2datacatalog.namespaces - R2 Data Catalog namespaces
  • radar.bots - Radar bot analytics
  • radar.ct - Radar certificate transparency data
  • radar.geolocations - Radar geolocation data
  • realtimekit.activesession - Real-time Kit active session management
  • realtimekit.analytics - Real-time Kit analytics
  • realtimekit.apps - Real-time Kit application management
  • realtimekit.livestreams - Real-time Kit live streaming
  • realtimekit.meetings - Real-time Kit meeting management
  • realtimekit.presets - Real-time Kit preset configurations
  • realtimekit.recordings - Real-time Kit recording management
  • realtimekit.sessions - Real-time Kit session management
  • realtimekit.webhooks - Real-time Kit webhook configurations
  • tokenvalidation.configuration - Token validation configuration
  • tokenvalidation.rules - Token validation rules
  • workers.beta - Workers beta features

New Endpoints (Existing Resources)

acm.totaltls

  • edit() - Added endpoint: /zones/{zone_id}/acm/total_tls
  • update() - Added endpoint: /zones/{zone_id}/acm/total_tls

cloudforceone.threatevents

  • list() - Added endpoint: /accounts/{account_id}/cloudforce-one/events/targetIndustries

contentscanning

  • create() - Added endpoint: /zones/{zone_id}/content-upload-scan/settings
  • get() - Added endpoint: /zones/{zone_id}/content-upload-scan/settings
  • update() - Added endpoint: /zones/{zone_id}/content-upload-scan/settings

dns.records

  • scan_list() - Added endpoint: /zones/{zone_id}/dns_records/scan/review
  • scan_review() - Added endpoint: /zones/{zone_id}/dns_records/scan/review
  • scan_trigger() - Added endpoint: /zones/{zone_id}/dns_records/scan/trigger

intel.indicatorfeeds

  • create() - Added endpoint: /accounts/{account_id}/intel/indicator-feeds/permissions/add
  • delete() - Added endpoint: /accounts/{account_id}/intel/indicator-feeds/permissions/remove
  • list() - Added endpoint: /accounts/{account_id}/intel/indicator-feeds/permissions/view

leakedcredentialchecks.detections

  • get() - Added endpoint: /zones/{zone_id}/leaked-credential-checks/detections/{detection_id}

queues.consumers

  • list() - Added endpoint: /accounts/{account_id}/queues/{queue_id}/consumers

radar.ai

  • summary() - Added endpoint: /radar/ai/bots/summary/{dimension}
  • timeseries() - Added endpoint: /radar/ai/bots/timeseries
  • timeseries_groups() - Added endpoint: /radar/ai/bots/timeseries_groups/{dimension}

radar.bgp

  • changes() - Added endpoint: /radar/bgp/rpki/aspa/changes
  • snapshot() - Added endpoint: /radar/bgp/rpki/aspa/snapshot

workers.subdomains

  • delete() - Added endpoint: /accounts/{account_id}/workers/subdomain

zerotrust.networks

  • create() - Added endpoint: /accounts/{account_id}/zerotrust/routes/hostname
  • delete() - Added endpoint: /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}
  • edit() - Added endpoint: /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}
  • get() - Added endpoint: /accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}
  • list() - Added endpoint: /accounts/{account_id}/zerotrust/routes/hostname

General Fixes and Improvements

Type System & Compatibility

  • Type inference improvements: Allow Pyright to properly infer TypedDict types within SequenceNotStr
  • Type completeness: Add missing types to method arguments and response models
  • Pydantic compatibility: Ensure compatibility with Pydantic versions prior to 2.8.0 when using additional fields

Request/Response Handling

  • Multipart form data: Correctly handle sending multipart/form-data requests with JSON data
  • Header handling: Do not send headers with default values set to omit
  • GET request headers: Don't send Content-Type header on GET requests
  • Response body model accuracy: Broad improvements to the correctness of models

Parsing & Data Processing

  • Discriminated unions: Correctly handle nested discriminated unions in response parsing
  • Extra field types: Parse extra field types correctly
  • Empty metadata: Ignore empty metadata fields during parsing
  • Singularization rules: Update resource name singularization rules for better consistency

v4.3.1

16 Jun 21:42
ac1ae1c

Choose a tag to compare

4.3.1 (2025-06-16)

Full Changelog: v4.3.0...v4.3.1

Bug Fixes

  • api: Update zone subscription paths (8917497)

Chores

  • internal: update conftest.py (c8ae1c4)

v4.3.0

16 Jun 18:16
d6670b6

Choose a tag to compare

4.3.0 (2025-06-16)

Full Changelog: v4.2.0...v4.3.0

Features

Bug Fixes

  • add back kv.namespaces bulk methods (5d271a4)
  • add missing properties (5777e78)
  • AI: Add explicit variant names for union types (332065c)
  • api: 'name' and 'type' are required on dns_record (d4795c5)
  • client: correctly parse binary response | stream (fceaf95)
  • config: Diagnostic errors (cb5769e)
  • DLP: Add explicit variant names (490c4a7)
  • docs/api: remove references to nonexistent types (e78bbed)
  • workers: correctly use multipart while uploading scripts (#2661) (756dc87)

Chores

  • api: Fix edge IPs variant names (fa43851)
  • api: mark some methods as deprecated (cc53052)
  • docs: remove reference to rye shell (8781542)
  • docs: remove unnecessary param examples (07f3fd3)
  • internal: codegen related update (09930a5)
  • internal: codegen related update (5fdf1d6)
  • tests: add tests for httpx client instantiation & proxies (0291352)
  • tests: run tests in parallel (cc4533e)

v4.2.0

21 May 19:18
475b534

Choose a tag to compare

4.2.0 (2025-05-21)

Full Changelog: v4.1.0...v4.2.0

Features

Bug Fixes

  • api: fix path placeholders (c8a0db8)
  • client: fix bug in Python SDK when subresource has the same name as its parent (c18a098)
  • package: support direct resource imports (7e46269)
  • urlscanner: don't unwwrap scan response (5fe7ea9)

Chores

  • ci: fix installation instructions (a9bc47f)
  • ci: upload sdks to package manager (c8af26d)
  • internal: avoid errors for isinstance checks on proxies (7b734a1)
  • internal: codegen related update (b1fdd11)

v4.1.0

18 Mar 04:42
fc6ca90

Choose a tag to compare

4.1.0 (2025-03-18)

Full Changelog: v4.0.0...v4.1.0

Features

Read more

v4.0.0

13 Jan 20:33
bf9d860

Choose a tag to compare

4.0.0 (2025-01-13)

Full Changelog: v3.1.1...v4.0.0

⚠ BREAKING CHANGES

  • addressing: reshuffle relationship in the namespace to align with the product (#2322)
  • r2: rename cf-r2-jurisdiction to more usable jurisdiction parameter (#2310)
  • r2: rename cf-r2-jurisdiction to more usable jurisdiction parameter (#2309)
  • r2: rename cf-r2-jurisdiction to more usable jurisdiction parameter (#2308)
  • loa_documents: move download subresource into parent as get (#2304)
  • addressing: move service bindings to dedicated namespace (#2303)
  • ai: move to dedicated namespace (#2269)
  • kv: move analytics under existing namespace (#2239)
  • zone_transfers: move under DNS namespace (#2234)
  • dnssec: move under DNS namespace (#2233)
  • url_scanner: swap all methods to be v2 only (#2231)
  • warp_connector: move under zero trust namespace (#2220)

Features

Read more

v3.1.0

16 Jul 23:53
0aed308

Choose a tag to compare

3.1.0 (2024-07-16)

Warning

v3.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 2.x releases for now.

Full Changelog: v3.0.1...v3.1.0

Features

  • api: add hash to url_scanner (28c06a7)
  • api: OpenAPI spec update via Stainless API (f0c26a0)
  • api: OpenAPI spec update via Stainless API (7850e20)
  • api: OpenAPI spec update via Stainless API (e91b45b)
  • api: OpenAPI spec update via Stainless API (a2433f4)
  • api: OpenAPI spec update via Stainless API (598836d)
  • api: OpenAPI spec update via Stainless API (512203e)
  • api: OpenAPI spec update via Stainless API (cf3b8d9)
  • api: OpenAPI spec update via Stainless API (cf6bd06)
  • api: OpenAPI spec update via Stainless API (ccaeebb)
  • api: OpenAPI spec update via Stainless API (4346909)
  • api: OpenAPI spec update via Stainless API (20e4aff)
  • api: OpenAPI spec update via Stainless API (9c895b4)
  • api: OpenAPI spec update via Stainless API (90c3186)
  • api: OpenAPI spec update via Stainless API (25951ee)
  • api: OpenAPI spec update via Stainless API (ca2bde2)
  • api: OpenAPI spec update via Stainless API (c2e0647)
  • api: OpenAPI spec update via Stainless API (74cd67c)
  • api: OpenAPI spec update via Stainless API (83cd3fd)
  • api: OpenAPI spec update via Stainless API (86075bb)
  • api: OpenAPI spec update via Stainless API (7b4ad6e)
  • api: OpenAPI spec update via Stainless API (11cfe41)
  • api: OpenAPI spec update via Stainless API (c3abf89)
  • api: OpenAPI spec update via Stainless API (1729a2c)
  • api: OpenAPI spec update via Stainless API (2516664)
  • api: OpenAPI spec update via Stainless API (2dce4af)
  • api: OpenAPI spec update via Stainless API (c08fb0d)
  • api: OpenAPI spec update via Stainless API (2fdfcf5)
  • api: OpenAPI spec update via Stainless API (c94a743)
  • api: OpenAPI spec update via Stainless API (87d6d49)
  • api: OpenAPI spec update via Stainless API (7fcc030)
  • api: OpenAPI spec update via Stainless API (64a4acd)
  • api: OpenAPI spec update via Stainless API (8607159)
  • api: OpenAPI spec update via Stainless API (e75f499)
  • api: OpenAPI spec update via Stainless API (8e5a9db)
  • api: OpenAPI spec update via Stainless API (53f952b)
  • api: OpenAPI spec update via Stainless API (9aae738)
  • api: OpenAPI spec update via Stainless API (17f284a)
  • api: OpenAPI spec update via Stainless API (1238133)
  • api: OpenAPI spec update via Stainless API (b80c95a)
  • api: OpenAPI spec update via Stainless API (1cba5a7)
  • api: OpenAPI spec update via Stainless API (852b7dc)
  • api: OpenAPI spec update via Stainless API (cf7cc16)
  • api: OpenAPI spec update via Stainless API (009cfad)
  • api: OpenAPI spec update via Stainless API (cfa4415)
  • api: OpenAPI spec update via Stainless API (c174dc7)
  • api: OpenAPI spec update via Stainless API (89d49a9)
  • api: OpenAPI spec update via Stainless API (f60b165)
  • api: OpenAPI spec update via Stainless API (93bdfad)
  • api: OpenAPI spec update via Stainless API (8110894)
  • api: OpenAPI spec update via Stainless API (74958bd)
  • api: OpenAPI spec update via Stainless API (fba0e37)
  • api: OpenAPI spec update via Stainless API (23722cc)
  • api: OpenAPI spec update via Stainless API (8236e8b)
  • api: OpenAPI spec update via Stainless API (5cf1dde)
  • api: OpenAPI spec update via Stainless API (a8cad59)
  • api: OpenAPI spec update via Stainless API (6134898)
  • api: OpenAPI spec update via Stainless API (d1df920)
  • api: OpenAPI spec update via Stainless API (03f1cd5)
  • api: OpenAPI spec update via Stainless API ([6fa0258](https://github.com/cloudflare/cloudflare-python/commit...
Read more

v3.0.1

24 Jun 22:57
087dd39

Choose a tag to compare

Merge pull request #1137 from cloudflare/release-please--branches--ma…

v3.0.0

24 Jun 22:01
7299d62

Choose a tag to compare

3.0.0 (2024-06-24)

Warning

v3.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 2.x releases for now.

Full Changelog: v3.0.0-beta.10...v3.0.0

Features

Read more