Cloudflare

Learn how to use Cloudflare with Composio

Overview

SLUG: CLOUDFLARE

Description

Cloudflare is a global network designed to make everything you connect to the Internet secure, private, fast, and reliable.

Authentication Details

generic_api_key
stringRequired
generic_id
stringRequired

Connecting to Cloudflare

Create an auth config

Use the dashboard to create an auth config for the Cloudflare toolkit. This allows you to connect multiple Cloudflare accounts to Composio for agents to use.

1

Select App

Navigate to Cloudflare.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Cloudflare Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4cloudflare_auth_config_id = "ac_YOUR_CLOUDFLARE_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Cloudflare for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, cloudflare_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Cloudflare toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Create DNS record

Description

Tool to create a new DNS record within a specific zone. Use after obtaining the zone ID to programmatically add DNS entries.

Action Parameters

comment
content
stringRequired
data
name
stringRequired
priority
proxied
tags
ttl
type
stringRequired
zone_identifier
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create WAF List

Description

Tool to create a new empty WAF list for the account. Use after confirming the account ID. Example: CREATE_LIST(account_id="<id>", kind="ip", name="blocklist")

Action Parameters

account_id
stringRequired
description
kind
stringRequired
name
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Zone

Description

Tool to create a new zone. Use after confirming account id when adding a domain to Cloudflare.

Action Parameters

account
jump_start
name
stringRequired
type
stringDefaults to full

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete DNS Record

Description

Tool to delete a DNS record within a specific zone. Use after confirming zone and record IDs. Example: "Delete DNS record 372e6795... from zone 023e105f4ecef..."

Action Parameters

identifier
stringRequired
zone_identifier
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete WAF List

Description

Tool to delete a WAF list. Use when you need to remove a list after verifying no filters reference it. Example: DELETE_LIST(account_id="<account_id>", list_id="<list_id>")

Action Parameters

account_id
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Zone

Description

Tool to delete a zone. Use after confirming the zone identifier to permanently remove a DNS zone from your Cloudflare account. Example: DELETE_ZONE(zone_identifier="023e105f4ecef8ad9ca31a8372d0c353")

Action Parameters

zone_identifier
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List WAF Lists

Description

Tool to fetch all WAF lists (no items) for an account. Use after confirming account ID.

Action Parameters

account_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Account Members

Description

Tool to list members of a given Cloudflare account. Use after confirming the account ID.

Action Parameters

account_id
stringRequired
direction
order
page
Defaults to 1
per_page
status

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Accounts

Description

Tool to list all accounts accessible to the user. Use when you need to enumerate Cloudflare accounts for selection or auditing.

Action Parameters

direction
name
page
Defaults to 1
per_page
Defaults to 20

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List DNS records

Description

Tool to list and search DNS records in a Cloudflare zone. Use when you need to find existing DNS record IDs for update or delete operations, especially after a "record already exists" error during creation. Returns matching records with their IDs, names, types, content, and other properties.

Action Parameters

comment_contains
content
content_contains
match
name
name_contains
page
per_page
proxied
type
zone_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Firewall Rules

Description

Tool to list firewall rules for a specific zone. Use after confirming the zone ID to retrieve and audit current firewall rules.

Action Parameters

direction
match
order
page
per_page
zone_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Monitors

Description

Tool to list all load-balancer monitors in a Cloudflare account. Use after creating or updating monitors to retrieve a paginated list.

Action Parameters

account_id
stringRequired
direction
order
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Pools

Description

Tool to list all load balancer pools in a Cloudflare account. Use after confirming account ID to discover pool IDs.

Action Parameters

account_id
stringRequired
direction
name
order
page
per_page

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Zones

Description

This tool lists, searches, sorts, and filters your zones.

Action Parameters

account
direction
match
Defaults to all
name
order
page
Defaults to 1
per_page
Defaults to 20
status

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Update DNS record

Description

Tool to update an existing DNS record within a specific zone. Use after confirming both zone and record identifiers; only provided fields are modified.

Action Parameters

content
data
identifier
stringRequired
name
priority
proxied
ttl
type
zone_identifier
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Update WAF List

Description

Tool to update the description of a WAF list (cannot update items). Use after confirming list metadata.

Action Parameters

account_id
stringRequired
description
stringRequired
list_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Update Zone

Description

Tool to update properties of an existing zone. Use after confirming the zone ID; only one field can be modified per call.

Action Parameters

paused
type
vanity_name_servers
zone_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired