---
title: "Save a Cloudflare API token"
method: PUT
path: "/dns-provider/cloudflare"
tags: ["domains"]
---

# Save a Cloudflare API token

`PUT /dns-provider/cloudflare`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/dns-provider/cloudflare`
- Auth: HTTP bearer

Verifies the token with the official Cloudflare API before saving (needs Zone → DNS → Edit) and stores it encrypted.

## Request body

- object
  - `apiToken` string: Cloudflare API Token

## Response `200`

Token saved

- object
  - `success` boolean, required
  - `message` string
  - `status` object, required
    - `provider` string, required
    - `configured` boolean, required
    - `tokenHint` string, nullable, required
    - `updatedAt` number, nullable, required

## Other responses

- `400`: Missing token or Cloudflare verification failed
- `401`: Missing or invalid API key
- `500`: Save failed
- `503`: Encryption key is not configured

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
