---
title: "Add Cloudflare account"
method: POST
path: "/api/v2/integrations/cloudflare/accounts"
tags: ["Cloudflare Integration"]
---

# Add Cloudflare account

`POST /api/v2/integrations/cloudflare/accounts`

Create a Cloudflare account.

## Request body

- CloudflareAccountCreateRequest — Payload schema when adding a Cloudflare account.
  - `data` CloudflareAccountCreateRequestData, required — Data object for creating a Cloudflare account.
    - `attributes` CloudflareAccountCreateRequestAttributes, required — Attributes object for creating a Cloudflare account.
      - `api_key` string, required — The API key (or token) for the Cloudflare account.
      - `email` string — The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.
      - `name` string, required — The name of the Cloudflare account.
      - `resources` string[] — An allowlist of resources to restrict pulling metrics for including `'web', 'dns', 'lb' (load balancer), 'worker'`.
      - `zones` string[] — An allowlist of zones to restrict pulling metrics for.
    - `type` 'cloudflare-accounts', required — The JSON:API type for this API. Should always be `cloudflare-accounts`.

## Response `201`

CREATED

- CloudflareAccountResponse — The expected response schema when getting a Cloudflare account.
  - `data` CloudflareAccountResponseData — Data object of a Cloudflare account.
    - `attributes` CloudflareAccountResponseAttributes, required — Attributes object of a Cloudflare account.
      - `email` string — The email associated with the Cloudflare account.
      - `name` string, required — The name of the Cloudflare account.
      - `resources` string[] — An allowlist of resources, such as `web`, `dns`, `lb` (load balancer), `worker`, that restricts pulling metrics from those resources.
      - `zones` string[] — An allowlist of zones to restrict pulling metrics for.
    - `id` string, required — The ID of the Cloudflare account, a hash of the account name.
    - `type` 'cloudflare-accounts', required — The JSON:API type for this API. Should always be `cloudflare-accounts`.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
