Common API calls · Cloudflare Web Application Firewall (WAF) docs | Latest TMZ Celebrity News & Gossip | Watch TMZ Live Skip to content
Cloudflare Docs

Common API calls

The following examples address common scenarios of using the Cloudflare API to manage and configure leaked credentials detection.

If you are using Terraform, refer to Terraform configuration examples.

General operations

The following API examples cover basic operations such as enabling and disabling the leaked credentials detection.

Turn on leaked credentials detection

To turn on leaked credentials detection, use a POST request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Account WAF Write
Set Leaked Credential Checks Status
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"enabled": true
}'

Turn off leaked credentials detection

To turn off leaked credentials detection, use a POST request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Account WAF Write
Set Leaked Credential Checks Status
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"enabled": false
}'

Get status of leaked credentials detection

To obtain the current status of the leaked credentials detection, use a GET request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Zone WAF Read
  • Account WAF Write
  • Account WAF Read
Get Leaked Credential Checks Status
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks" \
--request GET \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
"result": {
"enabled": true
},
"success": true,
"errors": [],
"messages": []
}

Custom detection location operations

The following API examples cover operations on custom detection locations for leaked credentials detection.

Add a custom detection location

To add a custom detection location, use a POST request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Account WAF Write
Create Leaked Credential Checks Custom Detection
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks/detections" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"username": "lookup_json_string(http.request.body.raw, \"user\")",
"password": "lookup_json_string(http.request.body.raw, \"secret\")"
}'

Get existing custom detection locations

To get a list of existing custom detection locations, use a GET request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Zone WAF Read
  • Account WAF Write
  • Account WAF Read
List Leaked Credential Checks Custom Detections
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks/detections" \
--request GET \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
"result": [
{
"id": "<DETECTION_ID>",
"username": "lookup_json_string(http.request.body.raw, \"user\")",
"password": "lookup_json_string(http.request.body.raw, \"secret\")"
}
// (...)
],
"success": true,
"errors": [],
"messages": []
}

Delete a custom detection location

To delete a custom detection location, use a DELETE request similar to the following:

Required API token permissions

At least one of the following token permissions is required:
  • Zone WAF Write
  • Account WAF Write
Delete Leaked Credential Checks Custom Detection
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/leaked-credential-checks/detections/$DETECTION_ID" \
--request DELETE \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.