API reference
Cloudflare
Cloudflare connection of an account: zones, record sync, proxy, cache purge.
#Disconnect Cloudflare
DELETE/api/v1/accounts/{id}/cloudflare
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfDisconnect · ky call cfDisconnect
Parameters
Responses
- 204 Done, no content
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Cloudflare connection and zones
GET/api/v1/accounts/{id}/cloudflare
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfOverview · ky call cfOverview
Parameters
Responses
- 200 OK
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Connect Cloudflare with an API token
PUT/api/v1/accounts/{id}/cloudflare
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfConnect · ky call cfConnect
Parameters
Request body
Responses
- 200 OK
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Unlink a domain from Cloudflare
DELETE/api/v1/accounts/{id}/cloudflare/zones/{zid}
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfUnlink · ky call cfUnlink
Parameters
Responses
- 204 Done, no content
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Link a domain to its Cloudflare zone
POST/api/v1/accounts/{id}/cloudflare/zones/{zid}
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfLink · ky call cfLink
Parameters
Request body
| Field | Type |
|---|
mail_elsewhere | boolean |
replace | array of string |
Responses
- 200 OK
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Create the Cloudflare zone for a domain
POST/api/v1/accounts/{id}/cloudflare/zones/{zid}/create
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfCreate · ky call cfCreate
Parameters
Request body
| Field | Type |
|---|
cf_account_id | string |
Responses
- 201 Created
Body
| Field | Type |
|---|
account_id always | string |
cf_status always | string |
cf_zone_id always | string |
created_at always | integer |
last_error | string |
last_plan always | any |
last_sync_at | integer |
name_servers always | array of string |
purge_on_deploy always | boolean |
ssl_strict always | boolean |
sync_status always | string |
zone_id always | string |
zone_name always | string |
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Change a zone's Cloudflare options
PUT/api/v1/accounts/{id}/cloudflare/zones/{zid}/options
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfOptions · ky call cfOptions
Parameters
Request body
| Field | Type |
|---|
purge_on_deploy | boolean |
ssl_strict | boolean |
Responses
- 200 OK
Body
| Field | Type |
|---|
purge_on_deploy | boolean |
ssl_strict | boolean |
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
#Preview the records a sync would change
GET/api/v1/accounts/{id}/cloudflare/zones/{zid}/preview
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfPreview · ky call cfPreview
Parameters
| Name | In |
|---|
id | path |
zid | path |
replace | query |
Responses
- 200 OK
Body
| Field | Type |
|---|
cf_status always | string |
cf_zone_id always | string |
mail_at_cloudflare always | boolean |
mail_note | string |
plan always | CloudflarePlan |
proxied always | integer |
skipped always | array of string |
zone always | string |
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Purge Cloudflare's cache
POST/api/v1/accounts/{id}/cloudflare/zones/{zid}/purge
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfPurge · ky call cfPurge
Parameters
Request body
| Field | Type |
|---|
hosts | array of string |
Responses
- 204 Done, no content
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare
#Sync the zone's records to Cloudflare
POST/api/v1/accounts/{id}/cloudflare/zones/{zid}/sync
- Who
- root, reseller (ACL: edit-dns); customer
- API tokens
- admin token area: accounts; account token area: cloudflare
- Feature
cloudflare- Operation
cfSync · ky call cfSync
Parameters
Responses
- 200 OK
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: cloudflare-permission
- 404 Not Found: cloudflare-zone-missing, not-found
- 409 Conflict: cloudflare-not-connected
- 500 Internal Server Error: internal
- 502 Bad Gateway: cloudflare