Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

client.rules.lists.items.delete - unexpected keyword argument 'items'

Open
#2,681 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start at the client.rules.lists.items.delete entry point and inspect its accepted parameters and request-body handling. Reproduce the call from the issue, then verify that passing items produces the valid Cloudflare delete request instead of a Python TypeError or invalid_json response.

Written by the indexing model from the issue text.

Description

Confirm this is a Python library issue and not an underlying Cloudflare API issue.
  • This is an issue with the Python library
Describe the bug

Calling the client.rules.lists.items.delete endpoint reutrns an "unexpected keyword argument 'items'" error. There is no way to pass a list of items to delete.

To Reproduce
  1. Call
client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),
)
item = client.rules.lists.items.delete(
    list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    items=[{"id": "1234567890"}]
)
  1. Return is TypeError: ItemsResource.delete() got an unexpected keyword argument 'items'
  2. Try
client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),
)
item = client.rules.lists.items.delete(
    list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    extra_body=json.dumps({"items":[{"id": "1234567890"}]})
)
  1. Return is cloudflare.BadRequestError: Error code: 400 - {'result': None, 'success': False, 'errors': [{'code': 10026, 'message': 'filters.api.invalid_json'}], 'messages': []}
Code snippets

OS

Ubuntu

Python version

3.12.3

Library version

4.3.1

Dominant language
Python
Stars
509
Forks
150
Avg merge
3h 15m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflare-python

All issues in cloudflare/cloudflare-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.