---
title: "Understanding Link Quotas & Usage Limits"
description: "Monitor monthly click traffic, active link limits, rate limits, and edge grace period thresholds."
---

> Documentation Index
> Fetch the complete documentation index at: https://shaf.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding Link Quotas & Usage Limits

# Understanding Link Quotas & Usage Limits

Unanticipated traffic surges from viral marketing campaigns can risk link disruption if usage caps are not monitored proactively. This guide explains how Shaf calculates monthly click quotas, enforces active link limits, and protects existing traffic with edge grace period buffers.

---

## Prerequisites

- Workspace permissions: `Owner` or `Admin` role in your Shaf organization.
- An active subscription plan on [dash.shaf.app](https://dash.shaf.app).

---

## What Counts Toward Quotas?

Shaf evaluates four distinct operational dimensions at the edge:

| Quota Dimension | What Is Counted | Reset Interval |
| :--- | :--- | :--- |
| **Monthly Click Events** | Every visitor redirect executed across system and custom domains. | Resets on monthly billing cycle. |
| **Active Links** | Total non-archived short links maintained in Cloudflare D1. | Cumulative (does not reset). |
| **Custom Domains** | Verified branded hostnames connected to your workspace. | Cumulative. |
| **Team Seats** | Active user accounts with assigned RBAC roles. | Cumulative. |

> **Bot Traffic Exemption**
>
> Shaf integrates Cloudflare Bot Management. Automated web crawlers, search indexers, and preview bots (e.g., Slack, Twitter/X, Discord scrapers) are verified and discounted from your **Monthly Click Events** tally.

---

## Implementation Recipe

1. **Monitor Real-Time Usage Meters**

   Inspect current utilization directly in the dashboard under **Settings → Billing**, or retrieve telemetry via the usage endpoint:

   ```bash
   curl -X GET "https://shaf.app/api/v1/organizations/org_01j8k9x2m4/usage" \
     -H "Authorization: Bearer $SHAF_API_TOKEN"
   ```

   **Expected response (`200 OK`):**

   ```json
   {
     "billingCycle": {
       "start": "2026-11-01T00:00:00Z",
       "end": "2026-12-01T00:00:00Z"
     },
     "usage": {
       "monthlyClicks": { "current": 42150, "limit": 250000, "percent": 16.86 },
       "activeLinks": { "current": 1240, "limit": 25000, "percent": 4.96 },
       "customDomains": { "current": 3, "limit": 5, "percent": 60.0 },
       "seats": { "current": 4, "limit": 5, "percent": 80.0 }
     }
   }
   ```
2. **Quota Threshold Lifecycle & Grace Buffer**

   Shaf applies tiered policies as usage approaches plan limits (refer to [Plans & Limits Reference](https://shaf.app/docs/docs/reference/plans-and-limits)):

   ```mermaid
   flowchart LR
     A[Monthly Cycle Active] --> B{Usage Threshold}
     B -->|80% Reached| C[⚠️ Soft Warning Email<br/>to Owner & Admins]
     B -->|100% Reached| D[🔴 Creation Suspended<br/>API returns 403 for new links]
     D --> E{Traffic Status?}
     E -->|Grace Buffer Active| F[✅ Existing links continue<br/>redirecting without interruption]
     E -->|Grace Buffer Exhausted| G[⚠️ Upgrade required to<br/>restore unthrottled routing]
   ```

   | Threshold | Operational Impact | Action Required |
   | :- | :- | :- |
   | **80% Soft Cap** | Automated warning email dispatched to workspace Owner and Admins. | Review growth trajectory and plan tier upgrade before peak. |
   | **100% Hard Cap** | New link creation suspended across dashboard and REST API (`403 Forbidden`). | Upgrade plan tier or delete/archive obsolete short links. |
   | **Grace Buffer** | Existing short links continue redirecting normally for a short grace window. | Upgrade plan before the grace period closes to avoid traffic throttling. |

---

## Verification

Query the rate limit and usage headers returned on standard API responses:

```bash
curl -I "https://shaf.app/api/v1/links" \
  -H "Authorization: Bearer $SHAF_API_TOKEN"
```

**Expected response headers:**
```http
HTTP/2 200 OK
x-ratelimit-limit: 1000
x-ratelimit-remaining: 994
x-shaf-quota-clicks-used: 42150
x-shaf-quota-clicks-limit: 250000
```

---

## Common Gotchas

| Issue / Error | Root Cause | Solution |
| :--- | :--- | :--- |
| `403 Forbidden: Link quota exceeded` | Workspace reached 100% of allowed Active Links. | Archive unused links via API or upgrade to a plan tier with higher link allowances. |
| Spike in click volume | Viral campaign or marketing launch exceeded expected traffic. | Upgrade tier in **Settings &rarr; Billing**; new capacity applies immediately at the edge. |
| Crawlers consuming quota | Third-party scraper spoofing residential user agents. | Shaf bot filtering excludes verified crawlers; contact enterprise support for custom WAF IP blocking. |
| API rate limits (`429`) | Script dispatched requests exceeding per-minute token rate limit. | Implement request throttling, batch queries via bulk endpoints, or use worker caches. |

Source: https://shaf.app/docs/how-to/workspaces-and-billing/usage-quotas-and-limits/index.mdx
