# Cloudflare in your Mac’s menu bar

See whether your Cloudflare Tunnels are connected and how your sites did over the last day without opening the dashboard. Each tunnel and each zone opens a page of its own.

## What you’ll see

- **Cloudflare:**
  - **Details:** your zones, your API token and any domains registered through Cloudflare. The health card turns orange when a zone is still waiting for Cloudflare’s nameservers or its nameservers have moved away, or the token has 14 days left (with its date saved), and red once the token has run out. Domains turn it orange 30 days before one without auto-renew expires and red in its last week; with auto-renew on, it names the next renewal.
  - **Last 24 hours:** requests, data served, the share served from Cloudflare’s cache, and the share that were server errors (5xx), added up across every zone in the account. Cloudflare counts these from a sample of visitors’ requests.
  - **Requests an hour:** each whole hour of the last day across the same zones, so a spike stands out.
  - **Tunnels:** every Cloudflare Tunnel as a dot, by name. Orange while it’s degraded, red while it’s down with no connections, grey for one that has never run. A dot that changes sends a notification. Each dot opens its tunnel’s page. An account with no tunnels doesn’t show the card.
  - **Zones:** your zones, a zone waiting for its nameservers first, then the busiest, with their requests and data served over the last day. A paused zone says so. Each opens its zone’s page.
  - **Billing:** your plans with their prices, the next renewal of a plan with a fixed price, and the last charge with its date and status. A click on the last charge opens its invoice. Products billed by use, such as R2 and Workers, show what they cost once Cloudflare charges for them, not as the month goes.
  - **Free allowance:** R2 storage and Class A and B operations this month against R2’s free 10 GB, 1 million and 10 million, and Workers requests in the last 24 hours against the Free plan’s 100,000 a day. Only what you use gets a row. On a paid Workers plan there’s no daily limit, so read the Workers row as a count. Storage is each bucket’s largest size this month, so it can read above what Cloudflare averages for the bill.
- **Zone:** one page for every zone, opened from its row and titled with its name:
  - **Details:** the zone’s edge certificates. The health card turns orange when one couldn’t be validated, issued or deployed, or has a week left without renewing, and red when one has expired. Cloudflare renews them about a month ahead.
  - **Controls:** a Security level menu, from Essentially off to I’m Under Attack; Development mode on or off, which skips the cache for three hours; and Purge cache, which asks first and removes every cached file.
  - **Requests a day** for the last 30 days.
  - **Last 30 days:** requests, the share cached, data served, its status and its plan.
  - **Responses** over the last day by status: 2xx, 3xx, 4xx and 5xx.
  - **Top countries** over the last day.
- **Tunnel:** one page for every tunnel, opened from its dot and titled with its name:
  - **Tunnel:** healthy, degraded, down or never run, since when, its connections and the Cloudflare data centres they reach.
  - **Last 24 hours:** a strip of how it stood every 15 minutes, from what the overview noted every 5 minutes while your Mac was awake.
  - **Connectors:** each `cloudflared` running it, with its version, platform, address and when it started. A connector on an older version than the latest `cloudflared` release on GitHub turns orange and says an update is available, and the card’s title names the latest release.

### Status

- Watches each Cloudflare Tunnel.
- Orange while a tunnel is degraded, red while it’s down with no connections.
- Grey for a tunnel that has never run.
- Details turns orange when a zone is waiting for its nameservers or they’ve moved away, the token has 14 days left, or a domain without auto-renew has 30 days left.
- A zone’s Details turns orange when a certificate stalls or has a week left.
- Notifies you when it turns orange or red.

## How it connects

The pages read Cloudflare’s API at `api.cloudflare.com` with an API token as a bearer token. Traffic comes from Cloudflare’s GraphQL Analytics API.

| Request | Pages | When | What it supplies |
| --- | --- | --- | --- |
| `GET /client/v4/accounts?per_page=5` | All | With each request that needs it | Your account, so the pages don’t ask for its ID. |
| `GET /client/v4/accounts/{account}/cfd_tunnel?is_deleted=false&per_page=100` | Cloudflare | Once a minute | Each tunnel and its state. |
| `GET /client/v4/zones?per_page=50&account.id={account}` | Cloudflare | Every 5 minutes | Your zones and their status. |
| `POST /client/v4/graphql` | Cloudflare | Every 5 minutes | The account’s last 24 hours: requests an hour, each zone’s requests, data served, server errors and cache. |
| `GET /client/v4/accounts/{account}/subscriptions` | Cloudflare | Once an hour | Your plans, their prices and when each renews. |
| `GET /client/v4/accounts/{account}/billing/history?per_page=20` | Cloudflare | Once an hour | Your charges, newest first. |
| `GET /client/v4/accounts/{account}/registrar/registrations` | Cloudflare | Every 6 hours | Domains registered through Cloudflare and when each expires. |
| `POST /client/v4/graphql` | Cloudflare | Once an hour | R2 storage and operations this month, and Workers requests in the last day. |
| `GET /client/v4/zones/{param.zone}` | Zone | Every 5 minutes | The zone, its status and plan. |
| `POST /client/v4/graphql` | Zone | Every 5 minutes | 30 days of requests a day, and the last day’s responses and countries. |
| `GET /client/v4/zones/{param.zone}/ssl/certificate_packs` | Zone | Every 6 hours | The zone’s edge certificates and when each expires. |
| `GET /client/v4/zones/{param.zone}/settings/security_level` and `…/development_mode` | Zone | Once a minute | The settings the Controls card shows. |
| `PATCH /client/v4/zones/{param.zone}/settings/…` | Zone | When you pick a security level or press Development mode | Changes that setting. |
| `POST /client/v4/zones/{param.zone}/purge_cache` | Zone | When you press Purge cache | Removes every cached file. |
| `GET /client/v4/accounts/{account}/cfd_tunnel/{param.id}` | Tunnel | Once a minute | The tunnel and its state. |
| `GET /client/v4/accounts/{account}/cfd_tunnel/{param.id}/connections` | Tunnel | Once a minute | Its connectors and their connections. |
| `GET https://api.github.com/repos/cloudflare/cloudflared/releases/latest` | Tunnel | Every 6 hours | The latest `cloudflared` release. Sent without your token. |

The token reads everything the pages show. Only the zone buttons change anything, and only with Edit on Zone Settings and Purge on Cache Purge. Cloudflare’s [API token docs](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) and [GraphQL Analytics API docs](https://developers.cloudflare.com/analytics/graphql-api/) have the rest. [Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.

## Set it up

1. **Make a token.** At [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens), create a custom user token. Give it Read on Account › Cloudflare Tunnel, Account Analytics, Billing and Registrar, and on Zone › Zone, Analytics, Zone Settings and SSL and Certificates. For the zone buttons, add Edit on Zone › Zone Settings and Purge on Zone › Cache Purge; leave those out for a token that only reads. Under Account Resources choose one account (the pages watch the first account the token can read), and under Zone Resources all zones from that account. You can give it an expiry date there. An account token works too, without the Domains card, since Cloudflare’s Registrar answers only user tokens.
2. **Save the token in Legato.** In Settings → Secrets, save it under `cloudflare`, bound to `api.cloudflare.com`, with the date it expires if you gave it one. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the pages.** Paste the prompt into your agent, or download the three pages and run `/Applications/Legato.app/Contents/Helpers/legato set cloudflare-zone cloudflare-zone.json`, then the same for `cloudflare-tunnel` and `cloudflare`. Keep the IDs `cloudflare-zone` and `cloudflare-tunnel`: every row and dot opens them.

The cards fill within a few minutes. A token without one of the permissions is the usual reason one doesn’t. Without a Read permission, the card that needs it notes that api.cloudflare.com turned it down; without Read on analytics, the page says so where the traffic would be.

### Prompt for your agent

```prompt
Add 3 Legato pages for Cloudflare, starting from https://legatobar.com/examples/cloudflare.json, https://legatobar.com/examples/cloudflare-zone.json, https://legatobar.com/examples/cloudflare-tunnel.json. Use the page IDs cloudflare, cloudflare-zone, cloudflare-tunnel if they’re free: the pages link to each other by those IDs, so with any other ID, change the matching legato://page/ links.

Add all three pages as they are, keeping their page IDs. I’ll save my Cloudflare API token as cloudflare in Settings → Secrets myself. Don’t press Purge cache, Development mode or the security level menu to test them.

Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```

### Download the pages

- [Download Cloudflare (cloudflare.json)](https://legatobar.com/examples/cloudflare.json)
- [Download Zone (cloudflare-zone.json)](https://legatobar.com/examples/cloudflare-zone.json)
- [Download Tunnel (cloudflare-tunnel.json)](https://legatobar.com/examples/cloudflare-tunnel.json)

## Questions

**Why don’t the totals match a zone list I can see?** Cloudflare counts traffic for zones its zone list leaves out, such as a workers.dev subdomain, so those requests are in the totals without a row of their own.

**Why are the numbers a little different from the dashboard?** The hour-by-hour figures come from Cloudflare’s sampled analytics, and the overview counts requests from visitors, leaving out ones your Workers make. The 30-day figures on a zone page are Cloudflare’s daily totals.

**Does it show security events?** No. The pages show traffic and tunnels only.

**Can it purge the cache or turn on Under Attack mode?** Yes, from a zone’s page, with a token that has Edit on Zone Settings and Purge on Cache Purge. Purge cache asks first. A token without them shows the buttons, and Cloudflare turns the press down.

## Verification

On 17 Nov 2026 all three pages were fetched through Legato from a live Free-plan account with one zone and one tunnel, and every card filled. The answers to a wrong token and to a token without Read on analytics were checked live too. A degraded or down tunnel, a zone waiting for its nameservers and an account with many zones were checked only against made-up answers.
