---
title: "Update Cloudflare account"
method: PATCH
path: "/api/v2/integrations/cloudflare/accounts/{account_id}"
tags: ["Cloudflare Integration"]
---

# Update Cloudflare account

`PATCH /api/v2/integrations/cloudflare/accounts/{account_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Update a Cloudflare account.

## Path parameters

- `account_id` string, required

## Request body

- CloudflareAccountUpdateRequest: Payload schema when updating a Cloudflare account.
  - `data` CloudflareAccountUpdateRequestData, required: Data object for updating a Cloudflare account.
    - `attributes` CloudflareAccountUpdateRequestAttributes: Attributes object for updating a Cloudflare account.
      - `api_key` string, required: The API key of 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: 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': The JSON:API type for this API. Should always be `cloudflare-accounts`.

## Response `200`

OK

- 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.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
