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

# Configure a Cloudflare D1 connection

> This guide explains how to create a Cloudflare API token with D1 read or edit access, how to find your Account ID and Database ID, and how to use them to add a new connection in SyneHQ.

## Prerequisites

* A Cloudflare account with access to the target account (and D1 enabled).
* The D1 database already created in your Cloudflare dashboard.

## Step 1: Create a Cloudflare API token

1. Sign in to the Cloudflare dashboard and go to **My Profile → API Tokens → Create Token**.
2. Choose **Create Custom Token** (or a D1 template if available) and give it a descriptive name such as **SyneHQ D1 Access**.

### Permissions for read-only access

* Add permission: **Account → Cloudflare D1 Databases → Read**.
* (Optional) Scope the token to a single account by selecting the specific **Account** under **Account Resources**.

### Permissions for read/write access

* Add permission: **Account → Cloudflare D1 Databases → Edit**.
* (Optional) Again, scope it to a single **Account** for least‑privilege access.

Then:

1. Set an **Account** under **Resources** to limit where this token applies.
2. Click **Continue to summary → Create Token**, then copy the generated token value and keep it somewhere secure; you will paste it into the **Cloudflare API Token** field in SyneHQ.

## Step 2: Find your Account ID and Database ID

### Locate Cloudflare Account ID

1. In the Cloudflare dashboard, open **Overview** for any site in the target account.
2. In the right sidebar, copy the **Account ID**; this is the value SyneHQ expects in the **Cloudflare Account ID** field.

### Locate D1 Database ID

1. Navigate to **Workers & Pages → D1** (or the D1 section under **Data** in Cloudflare).
2. Open your D1 database and copy its **Database ID** (sometimes labeled as **UUID** for the database); paste this later into the **Database ID** field in SyneHQ.

## Step 3: Add the connection in SyneHQ

In the SyneHQ UI, open the **Cloudflare D1** connection form.

<img src="https://mintcdn.com/synehq/SM8lETaAeaj4tTR8/images/2025-12-22_18-03-24.png?fit=max&auto=format&n=SM8lETaAeaj4tTR8&q=85&s=0bebae49ac1aae4bdc468d4ce0ad0d4f" alt="2025 12 22 18 03 24" width="1340" height="2024" data-path="images/2025-12-22_18-03-24.png" />

Fill in the fields as follows:

* **Name**: Any label you like for this connection (for example, `YIELDING_TURTLE`).
* **Database ID**: Paste the D1 Database ID copied from Cloudflare.
* **Cloudflare Account ID**: Paste the Account ID from the Cloudflare overview page.
* **Cloudflare API Token**: Paste the token you created in Step 1 (with Read or Edit permissions for D1).

Then click **Test Connection**; if it succeeds, click **Connect** to save the new Cloudflare D1 connection.

## Step 4: Allow SyneHQ’s IP if you use IP restrictions

If your Cloudflare or database setup uses IP‑based restrictions, add SyneHQ’s fixed IP address to your allowlist before testing the connection. The connection form displays the current **Our IP address is: 98.84.82.59** banner; copy this IP and whitelist it wherever you enforce network access controls (for example, firewall rules or Cloudflare Access lists).
