Using Cloudflare
Practical guide for working with Cloudflare DNS, Workers, KV, and zones through Fp Switchboard.
Quick Tips
Section titled “Quick Tips”- Zone ID, Account ID, DNS Record ID: all 32-char hex but NOT interchangeable
- Workers use SCRIPT NAME in URL (not an ID)
- KV: eventual consistency (60s delay), max 1 write/second to same key
- Authentication: Bearer token ONLY or X-Auth-Email + X-Auth-Key (never mix)
- DNS updates: lookup zone_id, then lookup record_id, then PUT with ALL fields
Common Gotchas
Section titled “Common Gotchas”IDs are Not Interchangeable Critical
Section titled “IDs are Not Interchangeable ”Zone ID, Account ID, DNS Record ID are all 32-char hex but cannot be used interchangeably.
| Example | |
|---|---|
| Wrong | Using Account ID where Zone ID is required |
| Correct | Get Zone ID from /zones?name=example.com |
Error: Invalid zone identifier
Workers Use Script Names Critical
Section titled “Workers Use Script Names ”Workers API uses human-readable script names, not IDs.
| Example | |
|---|---|
| Wrong | /workers/scripts/abc123 |
| Correct | /accounts/{account_id}/workers/scripts/my-worker-script |
Cannot Mix Auth Methods Critical
Section titled “Cannot Mix Auth Methods ”Use ONLY Bearer token OR ONLY X-Auth-Email + X-Auth-Key. Never both.
Error codes: 6003, 6103, 6111
KV Eventual Consistency Important
Section titled “KV Eventual Consistency ”KV changes may take 60+ seconds to propagate. Max 1 write/second to same key. Design for eventual consistency.
DNS Updates Need Full Payload Important
Section titled “DNS Updates Need Full Payload ”PUT /dns_records requires ALL fields (type, name, content, ttl, proxied), not just the changed ones.
Multi-Step Patterns
Section titled “Multi-Step Patterns”Update DNS Record
Section titled “Update DNS Record”GET /zones?name=example.comto get zone_idGET /zones/{zone_id}/dns_records?name=subdomain&type=Ato get record_idPUT /zones/{zone_id}/dns_records/{record_id}with ALL fields
Cloudflare Tenant (MSP)
Section titled “Cloudflare Tenant (MSP)”- Requires Cloudflare Partner Program membership
- Reuses existing Cloudflare API token — connect Cloudflare first
- Tenant account_id is different from your partner account_id
ID Format Reference
Section titled “ID Format Reference”| ID Type | Format | Example |
|---|---|---|
| Zone ID | 32-char hex | a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 |
| Account ID | 32-char hex | b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7 |
| DNS Record ID | 32-char hex | c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8 |
| Worker Script Name | Human-readable string | my-worker-script |
Example Prompts
Section titled “Example Prompts”- “List all DNS records for example.com”
- “Update the A record for api.example.com to 192.168.1.1”
- “List my Cloudflare zones”
- “Deploy a Workers script”
- “Create a KV namespace”
Rate Limits
Section titled “Rate Limits”| Limit | Value |
|---|---|
| Global | 1,200 requests/5 minutes |
| KV writes | 1 write/second per key |
| Workers invocations | Plan-dependent |