Skip to content
Skip to Content

Replace a zone's token

PUT
/dns-zones/{zoneId}/token

A new token for the same zone, such as after a rotation. Organization admins only.

Authorization

bearer
headerAuthorizationBearer <token>

An API key (opk_…) or a CLI token (opc_…).

Path parameters

zoneId*string

Request body

application/json
  1. body
token*string

A Cloudflare API token limited to one zone, with Zone → Zone → Read and Zone → DNS → Edit. Kept sealed and never returned.

Lengthlength <= 200

Response body

Replace a zone's token

application/json
  1. response
id*string
Formatuuid
provider*"cloudflare"
Value in"cloudflare"
zoneId*string

Cloudflare's id of the zone.

name*string

The zone, such as example.com.

sslMode*|

The zone's SSL/TLS mode when last checked (off, flexible, full, strict), or null when the token may not read it. Own domains behind Cloudflare need full.

createdAt*string
Formatdate-time
checkedAt*string
Formatdate-time
createdByName*string|null
domains*integer

Own domains whose records OpenPanel wrote in this zone.

Example request
curl -X PUT "https://openpanel.sh/api/v1/dns-zones/$ZONE_ID/token" \  -H "Authorization: Bearer $OPENPANEL_TOKEN" \  -H "Content-Type: application/json" \  -d '{  "token": "string"}'
Example response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "provider": "cloudflare",  "zoneId": "string",  "name": "string",  "sslMode": "string",  "createdAt": "2019-08-24T14:15:22Z",  "checkedAt": "2019-08-24T14:15:22Z",  "createdByName": "string",  "domains": 0}