Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,13 @@ jobs:
run: ./scripts/bootstrap

- name: Run tests
continue-on-error: true
run: ./scripts/test
env:
UV_PYTHON: ">=3.9.0"

examples:
timeout-minutes: 10
name: examples
continue-on-error: true
runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
detect_breaking_changes:
runs-on: 'ubuntu-latest'
name: detect-breaking-changes
if: false
permissions:
contents: read
steps:
Expand All @@ -28,12 +29,10 @@ jobs:
- name: Install dependencies
run: uv sync --all-extras
- name: Detect removed symbols
continue-on-error: true
run: |
uv run python scripts/detect-breaking-changes.py "${{ github.event.pull_request.base.sha }}"

- name: Detect breaking changes
continue-on-error: true
run: |
# Try to check out previous versions of the breaking change detection script. This ensures that
# we still detect breaking changes when entire files and their tests are removed.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
jobs:
publish:
name: publish
permissions:
contents: read
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ concurrency:
jobs:
release_doctor:
name: release doctor
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 2
if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: Semgrep config
jobs:
semgrep:
name: semgrep/ci
permissions:
contents: read
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
- .github/labels.yml
jobs:
build:
permissions:
issues: write # action-label-syncer creates/updates repo labels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.2.0"
".": "5.0.0-beta.2"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2277
configured_endpoints: 2284
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
openapi_spec_hash: c0d553c22ef1e807dd815f71023050f4
config_hash: 245f966442f3af14c23b79cbfdf06161
openapi_spec_hash: 26772c26b37d468fb9752aa22ea815b9
config_hash: 873a029df6d61c21b0ec8b6da9e67ce4
211 changes: 0 additions & 211 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,216 +1,5 @@
# Changelog

## 5.2.0 (2026-05-21)

Full Changelog: [v5.1.0...v5.2.0](https://github.com/cloudflare/cloudflare-python/compare/v5.1.0...v5.2.0)

### Features

* **ai_gateway:** update generated types and methods ([4923bbb](https://github.com/cloudflare/cloudflare-python/commit/4923bbb97bb42db7e8a6ae54cfa29d2e5bd99d47))
* **ai_security:** add ai_security resource ([29cb585](https://github.com/cloudflare/cloudflare-python/commit/29cb58506942df30e0cb087f2d7f211a53360d05))
* **cache:** update generated types and methods ([b7ae845](https://github.com/cloudflare/cloudflare-python/commit/b7ae845ad230f7db0aebfa30f84e6c7c0266278d))
* **ddos_protection:** add ddos_protection resource ([87f7e95](https://github.com/cloudflare/cloudflare-python/commit/87f7e95e47142d94642fa3ae865559b6c3af989b))
* **load_balancers:** update generated types and methods ([bb6815d](https://github.com/cloudflare/cloudflare-python/commit/bb6815d0212081da8f2e0e834d6d30e5fce78c41))
* **r2:** update generated types and methods ([72d2149](https://github.com/cloudflare/cloudflare-python/commit/72d2149e5b7905c4caf266dbefffa626eb4c2d13))
* **radar:** update generated types and methods ([fb2f0c4](https://github.com/cloudflare/cloudflare-python/commit/fb2f0c41d93bf66b8fff170e460ab79d19fc9fbb))
* **secrets_store:** update generated types and methods ([636414f](https://github.com/cloudflare/cloudflare-python/commit/636414fc201aba49dc31e544f024a67a1e7b5082))
* **workers_for_platforms:** update generated types and methods ([7bfed3c](https://github.com/cloudflare/cloudflare-python/commit/7bfed3ced962e765b884e68ae4c1c48e56e1b6b5))
* **workers:** update generated types and methods ([0bdb685](https://github.com/cloudflare/cloudflare-python/commit/0bdb6858af43a110a91a5d770b69367aca922117))
* **zero_trust:** update generated types and methods ([aeff7d5](https://github.com/cloudflare/cloudflare-python/commit/aeff7d56432a1f6844b310f9ce7fca9ac09da5e5))


### Chores

* **acm:** update generated types and methods ([8b03b3d](https://github.com/cloudflare/cloudflare-python/commit/8b03b3dc081c0fa7cf6bbaca188927379c418b93))
* **ai:** update generated types and methods ([2f6bdf7](https://github.com/cloudflare/cloudflare-python/commit/2f6bdf7476969dad83fe85c0ae493d7b3f4fa58c))
* **api_gateway:** update generated types and methods ([5b79a34](https://github.com/cloudflare/cloudflare-python/commit/5b79a34891fe355456e1decebcf462ac1e171ff5))
* **cloudforce_one:** update generated types and methods ([fc72368](https://github.com/cloudflare/cloudflare-python/commit/fc723685b90eafb8a2f232c72e6f03dd4ad2f823))
* **d1:** update generated types and methods ([6a05b68](https://github.com/cloudflare/cloudflare-python/commit/6a05b682b6b8a3d1bc64440de52a17d4e8df9034))
* **email_security:** update generated types and methods ([c89d1ce](https://github.com/cloudflare/cloudflare-python/commit/c89d1ceeb880ff26c06707731b17e4f2e7041b3d))
* **intel:** update generated types and methods ([b097e5d](https://github.com/cloudflare/cloudflare-python/commit/b097e5d93a5a3c2626088a2132d75625755c2141))
* **logpush:** update generated types and methods ([f26713b](https://github.com/cloudflare/cloudflare-python/commit/f26713be3354fc403b062b15d0c191fadec283d0))
* **resource_sharing:** update generated types and methods ([792bf24](https://github.com/cloudflare/cloudflare-python/commit/792bf248ba72dfc93e5bc4b79734475ece24d52b))
* restore version ([9f99d4b](https://github.com/cloudflare/cloudflare-python/commit/9f99d4b9d86612713073afd9144de0512df6442b))
* sync shared codegen files from staging-next ([fbb556c](https://github.com/cloudflare/cloudflare-python/commit/fbb556c19cb25f308ba43c94959c669b772f6663))

## 5.1.0 (2026-05-06)

Full Changelog: [v5.0.0...v5.1.0](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0...v5.1.0)

### Features

* **security_center:** add `audit_logs`, `classification`, and `context` sub-resources to insights ([ed7d261](https://github.com/cloudflare/cloudflare-python/commit/ed7d261e6))
* **zero_trust:** add `deployment_groups` sub-resource to devices ([7121a55](https://github.com/cloudflare/cloudflare-python/commit/7121a55d3))
* **aisearch:** update generated types and methods ([54b87759](https://github.com/cloudflare/cloudflare-python/commit/54b87759b))
* **email_security:** update generated types and methods ([23a979df](https://github.com/cloudflare/cloudflare-python/commit/23a979df2))
* **radar:** update generated types and methods ([b48274ef](https://github.com/cloudflare/cloudflare-python/commit/b48274ef7))
* **zones:** update generated types and methods ([f0a54099](https://github.com/cloudflare/cloudflare-python/commit/f0a540997))

#### Security Center - New Insights Sub-Resources

**AuditLogs** (`client.security_center.insights.audit_logs`)

- `list(*, account_id, zone_id, **params) -> SyncCursorPagination[AuditLogListResponse]`
- `list_by_insight(issue_id, *, account_id, zone_id, **params) -> SyncCursorPagination[AuditLogListByInsightResponse]`

New types:
```python
from cloudflare.types.security_center.insights import (
AuditLogListResponse,
AuditLogListByInsightResponse,
)
```

**Classification** (`client.security_center.insights.classification`)

- `update(issue_id, *, account_id, zone_id, **params) -> ClassificationUpdateResponse`

New types:
```python
from cloudflare.types.security_center.insights import ClassificationUpdateResponse
```

**Context** (`client.security_center.insights.context`)

- `get(issue_id, *, account_id) -> Optional[ContextGetResponse]`

New types:
```python
from cloudflare.types.security_center.insights import ContextGetResponse
```

#### Zero Trust - Device Deployment Groups

New sub-resource `client.zero_trust.devices.deployment_groups`:

- `create(*, account_id, **params) -> DeploymentGroup`
- `list(*, account_id, **params) -> SyncV4PagePaginationArray[DeploymentGroup]`
- `delete(group_id, *, account_id) -> DeploymentGroupDeleteResponse`
- `edit(group_id, *, account_id, **params) -> DeploymentGroup`
- `get(group_id, *, account_id) -> DeploymentGroup`

New types:
```python
from cloudflare.types.zero_trust.devices import DeploymentGroup, DeploymentGroupDeleteResponse
```

## 5.0.0 (2026-04-30)

Full Changelog: [v4.3.1...v5.0.0](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0)

This is a major release of the Cloudflare Python SDK. It drops support for
Python 3.8, adds 11 new API services, introduces optional aiohttp backend
support for improved async concurrency, and includes hundreds of type and
method updates across the entire API surface.

Please review the breaking changes below before upgrading. A migration guide
is available at [docs/migration-guides/v5.0.0-migration-guide.md](./docs/migration-guides/v5.0.0-migration-guide.md).

---

#### Breaking Changes

- **Python 3.8 is no longer supported.** The minimum required version is now Python 3.9. ([pyproject.toml](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0))
- **`typing-extensions` minimum version bumped** from `>=4.10` to `>=4.14`.

Additionally, the following resources have breaking changes:

- `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`

See the [v5.0.0 Migration Guide](./docs/migration-guides/v5.0.0-migration-guide.md) for upgrade instructions and resource-specific guidance.

---

#### Features

* **aiohttp backend support:** The async client now supports an optional `aiohttp` HTTP backend for improved concurrency performance. Install with `pip install cloudflare[aiohttp]` and use `DefaultAioHttpClient()` as the `http_client` parameter.
* **Python 3.13 and 3.14 support** added as tested classifiers.

##### New Services

The following top-level resources are new in this release:

* **AISearch** (`aisearch`): AI-powered search capabilities
* **Connectivity** (`connectivity`): Connectivity testing and diagnostics
* **EmailSending** (`email_sending`): Email send and send_raw endpoints
* **Fraud** (`fraud`): Fraud detection and prevention
* **GoogleTagGateway** (`google_tag_gateway`): Google Tag Gateway management
* **Organizations** (`organizations`): Organization audit logs and management
* **R2DataCatalog** (`r2_data_catalog`): R2 Data Catalog operations
* **RealtimeKit** (`realtime_kit`): Realtime communication (Calls/TURN)
* **ResourceTagging** (`resource_tagging`): Resource tagging and labeling
* **TokenValidation** (`token_validation`): Token validation configuration and rules
* **VulnerabilityScanner** (`vulnerability_scanner`): Vulnerability scanning, credential sets, and target environments

##### New Endpoints on Existing Services

* **accounts:** update generated types and methods
* **api_gateway:** add labels endpoints (WAM-1196)
* **billing:** add billable usage PayGo endpoint
* **brand_protection:** add v2 endpoints
* **browser_rendering:** add devtools methods (BRAPI-1051)
* **cache:** add origin cloud regions resource
* **custom_origin_trust_store:** enable custom origin trust store
* **dns:** add dns_records/usage endpoints (DNS-12466)
* **email_security:** add phishguard reports endpoint
* **iam:** add user_groups and user_group_members resources
* **radar:** add Botnet Threat Feed and Post-Quantum endpoints
* **workers:** add Observability Destinations resources (WO-989)
* **zero_trust:** add Access Users endpoint (AUTH-7071), DEX rules, Device IP Profile, Device Subnet, WARP Connector connections and failover endpoints, WARP Subnet endpoints, Gateway PAC files (GIN-1439)
* **zones:** add zone environments endpoints

##### Updated Services

Nearly every existing service received type and method updates through
composite API spec refreshes. Notable updates include:

* **email_security:** remove deprecated type definitions
* **radar:** restructured to use per-resource api.md sub-files (no client path changes)
* **workers_for_platforms:** update generated types
* **r2:** update generated types
* **fraud:** update generated types and methods


#### Bug Fixes

* **_models:** add `polymorphic_serialization` parameter to `model_dump` overrides ([342b5a8](https://github.com/cloudflare/cloudflare-python/commit/342b5a84daaf5c09e3e1612809d956d916a43621))
* **pipelines:** add `BaseModel` base to response `SchemaFieldStruct`/`SchemaFieldList` stubs ([d33af8b](https://github.com/cloudflare/cloudflare-python/commit/d33af8b5d5c1705fde4ae73efdbe3bfe3ba321df))
* **dlp:** add missing `model_rebuild`/`update_forward_refs` for `SharedEntryCustomEntry` classes ([25ec10c](https://github.com/cloudflare/cloudflare-python/commit/25ec10c814d138f8dea08a79f9984b70abb58477))
* **workers:** make `RunQueryParametersNeedleValue` a `BaseModel` with `arbitrary_types_allowed` ([6b7efbc](https://github.com/cloudflare/cloudflare-python/commit/6b7efbc51e6189ba18225c57637015f050060683))
* **stream:** remove duplicate `notification_url` field in webhook response types ([fc9fb2f](https://github.com/cloudflare/cloudflare-python/commit/fc9fb2f895c5de968f67c62bb599a6792be9fa8f))
* resolve pre-existing codegen type errors ([fed88d6](https://github.com/cloudflare/cloudflare-python/commit/fed88d6c5a5e482a9de595a1431915320fa11d23))
* **radar:** fix `type: ignore[call-arg]` placement for mypy compatibility ([fac9404](https://github.com/cloudflare/cloudflare-python/commit/fac9404ebfa1eb5383a3d3c54f49e4120eb8cd11))
* fix broken reference for the queues `consumer` model ([3f5cf39](https://github.com/cloudflare/cloudflare-python/commit/3f5cf39405b6b38fc594ce348d93a6e7da92c276))


#### Chores

* **build:** migrate from rye to uv for project management ([2f283c2](https://github.com/cloudflare/cloudflare-python/commit/2f283c29584b49e7c000f5e04aa5edc62db36ab9))
* **ci:** pin single Python version and pydantic v2 for test runs ([86676bc](https://github.com/cloudflare/cloudflare-python/commit/86676bca670d38d5947041bc5677138640dd6d92))
* **typing:** add mypy configuration with strict mode ([pyproject.toml](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0))
* **api:** 80+ composite API spec updates across the release cycle


#### Documentation

* add Authentication section to README ([70d934a](https://github.com/cloudflare/cloudflare-python/commit/70d934abd91cfa8f8444e0651ac97012c1d0edcf))
* add aiohttp backend usage instructions to README
* add MCP server integration badges (Cursor, VS Code)

## 5.0.0-beta.2 (2026-04-20)

Full Changelog: [v5.0.0-beta.1...v5.0.0-beta.2](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0-beta.1...v5.0.0-beta.2)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The REST API documentation can be found on [developers.cloudflare.com](https://d

```sh
# install from PyPI
pip install cloudflare
pip install --pre cloudflare
```

## Usage
Expand Down Expand Up @@ -90,7 +90,7 @@ You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install cloudflare[aiohttp]
pip install --pre cloudflare[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ from cloudflare.types import (

# [Addressing](src/cloudflare/resources/addressing/api.md)

# [DLS](src/cloudflare/resources/dls/api.md)

# [AuditLogs](src/cloudflare/resources/audit_logs/api.md)

# [Billing](src/cloudflare/resources/billing/api.md)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cloudflare"
version = "5.2.0"
version = "5.0.0-beta.2"
description = "The official Python library for the cloudflare API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
Loading
Loading