Lodol Docs

Cloudflare

API actions for the Cloudflare integration.

Cloudflare

Manage DNS records, clear cached content, and turn development mode on or off for your Cloudflare sites.


Create DNS record

Create a new DNS record in a Cloudflare zone.

Parameters

ParameterTypeRequiredDescription
zone_idstringYesThe ID of the zone
record_typestringYesThe DNS record type (e.g., A, AAAA, CNAME, TXT, MX)
namestringYesThe DNS record name (for example, a subdomain like www, or @ for the root domain)
contentstringYesWhat the record points to (for example, an IP address or a domain name)
ttlnumberNo[Optional] How long DNS servers keep this record before refreshing, in seconds (1 for automatic)
proxiedbooleanNo[Optional] Set to true to route traffic through Cloudflare, or false for DNS only

Response

{
  "content": "192.0.2.1",
  "id": "mock_record_id",
  "name": "example.com",
  "proxied": false,
  "type": "A"
}

Get zone details

Retrieve detailed information about a specific Cloudflare zone.

Parameters

ParameterTypeRequiredDescription
zone_idstringYesThe ID of the zone

Response

{
  "id": "mock_zone_id",
  "name": "example.com",
  "plan": "Free",
  "status": "active"
}

List zones

List the zones (websites) in your Cloudflare account, with optional filters by domain name and status.

Parameters

ParameterTypeRequiredDescription
namestringNo[Optional] Filter zones by domain name
statusstringNo[Optional] Filter zones by status (e.g., active, pending)
pagenumberNo[Optional] Which page of results to return (default: 1)
per_pagenumberNo[Optional] Number of zones per page (default: 20)

Response

{
  "count": 1,
  "zones": [
    {
      "id": "mock_zone_id",
      "name": "example.com",
      "status": "active"
    }
  ]
}

Purge cache

Clear cached content from a Cloudflare zone, either specific files or everything.

Parameters

ParameterTypeRequiredDescription
zone_idstringYesThe ID of the zone
filesarrayNo[Optional] The URLs to clear from the cache
purge_everythingbooleanNo[Optional] Set to true to clear all cached content (default: false)

Response

{
  "purge_everything": false,
  "status": "ok"
}

Turn development mode on or off

Turn development mode on or off for a Cloudflare zone. Development mode temporarily bypasses the cache so site changes show up right away.

Parameters

ParameterTypeRequiredDescription
zone_idstringYesThe ID of the zone
enablebooleanYesSet to true to enable development mode, false to disable

Response

{
  "enabled": true
}

Update DNS record

Update an existing DNS record in a Cloudflare zone.

Parameters

ParameterTypeRequiredDescription
zone_idstringYesThe ID of the zone
record_idstringYesThe ID of the DNS record to update
record_typestringYesThe DNS record type (e.g., A, AAAA, CNAME, TXT, MX)
namestringYesThe DNS record name (for example, a subdomain like www, or @ for the root domain)
contentstringYesWhat the record points to (for example, an IP address or a domain name)
ttlnumberNo[Optional] How long DNS servers keep this record before refreshing, in seconds (1 for automatic)
proxiedbooleanNo[Optional] Set to true to route traffic through Cloudflare, or false for DNS only

Response

{
  "content": "192.0.2.1",
  "id": "mock_record_id",
  "name": "example.com",
  "proxied": false,
  "type": "A"
}

On this page