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

# Cloudflare

The following steps outline how to create an Cloudflare integration in Encord.

## 1. Configure Cloudflare

1. Log into Cloudflare.

   The Cloudflare dashboard appears.

2. Click the account where your bucket is located.

   The *Account home* page appears.

3. Click **R2 object storage** from the left hand navigation.

   The *Overview R2 Object Storage* page appears.

   ![R2 object storage](https://storage.googleapis.com/docs-media.encord.com/static/img/integration-cloudflare-01.png)

4. Click **Manage**.

   The *API tokens* page appears.

   ![Create API token](https://storage.googleapis.com/docs-media.encord.com/static/img/inetgration-cloudflare-02.png)

5. Click **Create Account API token** or **Create User API token** depending on your Cloudflare account privileges.

   The *Create User API Token* page appears.

   ![Create API token](https://storage.googleapis.com/docs-media.encord.com/static/img/integration-cloudflare-03.png)

6. Specify permissions on one or more storage buckets:

   * **Permissions:**
     * For functionality: Select **Object Read & Write**
     * For limited functionality: Select **Object Read only**

   * **Buckets**
     * For simplicity: Select **Apply to all buckets in this account**
     * For Security: Select **Apply to specific buckets only**

7. Click **Create Account/User API token**.

   The *Summary* page for the API token appears.

8. Record the `Access Key ID` and `Secret Access Key`.

   ![Create API token](https://storage.googleapis.com/docs-media.encord.com/static/img/integration-cloudflare-04.png)

9. Click **Finish**.

10. Return to the *R2 object storage Overview* page.

![Record Account ID](https://storage.googleapis.com/docs-media.encord.com/static/img/integration-cloudflare-05a.png)

11. Record the `Account ID`.

12. (OPTIONAL: CORS Policy) Click the bucket the API token is applied to.

    The *Objects* page for the bucket appears.

    ![Objects page](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations-cloudflare-06.png)

13. Click **Settings**.

    The *Settings* page for the bucket appears.

    ![Settings page](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations-cloudflare-07.png)

14. Click **CORS Policy**.

    The *Settings* page moves to the *CORS Policy* section.

    <Warning>
      Applying Encord required CORS settings may overwrite existing configurations on your cloud storage bucket. If your bucket already has CORS settings, make sure to append Encord’s required settings instead of replacing them.
    </Warning>

15. Click **+ Add**.

    The *CORS Policy* panel appears.

    ![CORS Policy panel](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations-cloudflare-08.png)

16. Copy the following into the workspace:

<CodeGroup>
  ```json Global theme={"dark"}
  [
      {
          "AllowedHeaders": [
              "*"
          ],
          "AllowedMethods": [
              "GET"
          ],
          "AllowedOrigins": [
              "https://app.encord.com",
              "https://api.encord.com",
              "https://api.us.encord.com",
              "https://app.us.encord.com"
          ],
          "ExposeHeaders": []
      }
  ]
  ```

  ```json EU theme={"dark"}
  [
      {
          "AllowedHeaders": [
              "*"
          ],
          "AllowedMethods": [
              "GET"
          ],
          "AllowedOrigins": [
              "https://app.encord.com",
              "https://api.encord.com",
          ],
          "ExposeHeaders": []
      }
  ]
  ```

  ```json US theme={"dark"}
  [
      {
          "AllowedHeaders": [
              "*"
          ],
          "AllowedMethods": [
              "GET"
          ],
          "AllowedOrigins": [
              "https://api.us.encord.com",
              "https://app.us.encord.com"
          ],
          "ExposeHeaders": []
      }
  ]
  ```
</CodeGroup>

16. Click **Save**.

You are now ready to proceed to *STEP 2: Encord Configuration*.

## 2. Encord Configuration

1. Navigate to [Workspace Settings](/platform-documentation/General/general-workspace-settings#workspace-settings) > Cloud Buckets and click **+New integration** to create a new integration.

   The integration dialog appears.

2. Select *Cloudflare* in the integration dialog.

   ![New Integration](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations/Cloudflare/integrations-cf-encord-step-01.png)

3. Provide a meaningful name for the integration.

   ![Cloudflare integration](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations/Cloudflare/integrations-cf-encord-step-02.png)

4. Paste the following, from Cloudflare, into step 3:

   * `Account ID`
   * `Access Key ID`
   * `Secret Access Key`

   ![Cloudflare keys and ID](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations/Cloudflare/integrations-cf-encord-step-03.png)

5. Specify **Advanced settings** for tighter security if required.

   ![Advanced settings](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations/Cloudflare/integrations-cf-encord-step-04.png)

6. Click **Create**.

   The integration appears in the *Integrations* list.

   ![Create](https://storage.googleapis.com/docs-media.encord.com/static/img/integrations/Cloudflare/integrations-cf-encord-step-05.png)
