> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare

> Connect a Cloudflare API token to nOps for product cost and usage visibility

## Overview

nOps uses your **Cloudflare account ID** and an API token to pull product usage and contracted cost into Inform, plus zone and account usage when the token includes the analytics permissions below. The token is stored securely, validated before save, and is not shown again after you connect.

Cloudflare's billable usage API covers **self-serve accounts only**. Enterprise contracts are not included yet. Connecting an Enterprise account will not produce cost data in Inform.

Usage is updated **daily**. Cost appears in Inform after that sync, which can take up to **24 hours**.

## Prerequisites

* A **self-serve** Cloudflare account
* An API token with **Billing Read** and the [analytics permissions](#token-permissions) below
* nOps organization **administrator** access

> [!NOTE]
>
> Only **admins** and **owners** can connect, re-validate, or disconnect. **Members** see **Admin
> Only** on connectable cards.

## Create a Cloudflare API token

1. Sign in to the [Cloudflare dashboard](https://dash.cloudflare.com).
2. Open **My Profile → API Tokens → Create Token**.
3. Choose **Create Custom Token**.
4. Add every permission in [Token permissions](#token-permissions). Include the optional rows only if you want R2 bucket or Images stats.
5. Under **Account Resources**, include the account you want nOps to read.
6. Under **Zone Resources**, include the zones you want nOps to read (or all zones). Zone permissions do nothing until a zone is included.
7. Create the token and copy it immediately. It is typically shown only once.
8. Copy your **Account ID**. It is the 32-character value in the dashboard URL (`https://dash.cloudflare.com/<account_id>/...`) or on the account home page.

> [!WARNING]
>
> The token **must** include **Account → Billing → Read**. A token without that permission cannot
> read billable usage, and nOps will not store it. Add the other required permissions so nOps can
> see zones, requests, and account usage.

## Token permissions

Create a custom token and add these permissions.

### Required

| Type | Permission | Access | What nOps can see |
| - | - | - | - |
| Account | Billing | Read | Product usage and contracted cost (self-serve accounts) |
| Account | Account Analytics | Read | Account-level usage analytics, such as R2 storage and operations |
| Zone | Zone | Read | The list of zones in your account |
| Zone | Analytics | Read | Requests and bandwidth per zone |

### Optional

| Type | Permission | Access | What nOps can see |
| - | - | - | - |
| Account | Workers R2 Storage | Read | Your R2 bucket list, so nOps can attribute R2 usage. Cloudflare's read permission also allows reading stored objects; nOps only lists buckets. |
| Account | Cloudflare Images (may be listed as "Images") | Read | Images storage stats (image count against your allowance). This permission can also list stored images. |

## Connect in nOps

### Where to open Cloudflare

* **To connect for the first time:** go to **Settings → Integrations** (`/settings/integrations` or **View all**) and click the **Cloudflare** card.
* **To manage an existing connection:** go to **Settings → Account Status → Connected apps** and click the **Cloudflare** chip to re-validate or disconnect.

### Connect steps

1. Click the **Cloudflare** card or chip.
2. Paste your **Account ID** and **API token**, then click **Connect**.

nOps checks the account ID and token against Cloudflare's billable usage API before storing them. On success, the catalog shows **Integrated** or Connected apps shows **Connected**.

## What nOps brings back

After the daily sync, Inform can show:

* Product name (`ServiceName` and `ServiceFamilyName`)
* Charge period
* Quantity
* Contracted cost (`ContractedCost`)
* Zone, when Cloudflare includes one (`ZoneId` / `ZoneName`)

> [!NOTE]
>
> This API does not cover **Enterprise** contracts. If your Cloudflare account is Enterprise, the
> connection will not produce cost rows in Inform.

## Manage your connection

Administrators can **Re-validate** stored credentials or **Disconnect** from the same modal. **Action required** means the token was revoked or no longer has Billing Read. Fix the token in Cloudflare, then re-validate or connect again.

## Troubleshooting

* **Invalid token:** confirm there are no typos and that the token is still active in Cloudflare.
* **Missing Billing Read:** edit the token (or create a new one) so it includes **Account → Billing → Read**, then connect again.
* **Missing zones, requests, or account usage:** add **Account Analytics**, **Zone**, and **Zone → Analytics**, and include those zones under **Zone Resources**. Add **Workers R2 Storage** or **Cloudflare Images** only if you want bucket or image stats. Then **Re-validate**.
* **Wrong account ID:** use the 32-character ID from the dashboard URL or account home. It must match the account the token can read.
* **No data yet:** allow up to **24 hours** after connect. Usage is refreshed once a day, and a new account may have no billable rows yet.
* **Enterprise account:** self-serve usage is the only data this connection can read. Enterprise contracts are not in the billable usage API yet.
* **Rate limits:** wait briefly and use **Re-validate**.

## Security

Treat the API token like a password. Rotate it on a schedule, and keep the token scoped to the [permissions above](#token-permissions) on the account you want nOps to see.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.