> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/c/cloudflare.md).

# Cloudflare

Cloudflare provides DNS, CDN and security services. OctoXLabs uses the Cloudflare API to add the TLS certificates of your zones to the certificate inventory.

## Use cases

* List Cloudflare certificates that expire within 7 days.

```
Adapters = cloudflare AND ExpiryDate next now+7d/d
```

* List every certificate Cloudflare reports.

```
Adapters = cloudflare
```

## Before you begin

### Network

| Source              | Destination        | Port | Protocol |
| ------------------- | ------------------ | ---- | -------- |
| OctoXLabs connector | api.cloudflare.com | 443  | HTTPS    |

### Required permissions

| Scope or role | Permission | Needed for                                               |
| ------------- | ---------- | -------------------------------------------------------- |
| Not verified  | Read       | Zones and certificates (client, origin CA, custom, edge) |

## Create credentials in Cloudflare

{% stepper %}
{% step %}

### Open API tokens

Sign in to the Cloudflare dashboard and go to **My Profile > API Tokens > Create Token** (user-owned tokens).
{% endstep %}

{% step %}

### Pick a template

Choose a template or **Create Custom Token**.
{% endstep %}

{% step %}

### Set permissions

Set permissions with least privilege and select the resources (specific zones or the account).
{% endstep %}

{% step %}

### Create the token

Select **Continue to summary**, then **Create Token**. Copy the token.

{% hint style="warning" %}
Cloudflare shows the token only once. Save it first.
{% endhint %}
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                     | Required | Type     | Default | Description                                                                                           |
| ----------------------------- | -------- | -------- | ------- | ----------------------------------------------------------------------------------------------------- |
| API Token                     | Yes      | Password |         | Cloudflare API token.                                                                                 |
| Fetch All Status Certificates | No       | Boolean  | True    | Fetch certificates of every status. When off, only active certificates are fetched.                   |
| Thread Count                  | No       | Number   | 16      | Parallel threads. Higher values speed up the run and use more memory. The baseline documents 1 to 32. |
| HTTPS Proxy                   | No       | Text     |         | Proxy URL.                                                                                            |
| Sleep Time                    | No       | Number   | 0       | Delay in seconds between thread batches. Raise it on rate limit errors.                               |
| Timeout                       | No       | Number   | 30      | Seconds to wait for API responses.                                                                    |

## Troubleshooting

No adapter-specific error messages are documented for this adapter.

## Change history
