KyPanelDocs

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

NameIn
idpath

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

NameIn
idpath

Responses

  • 200 OK
    Body
    FieldType
    connectionStoreCloudflareConnection
    domains alwaysarray of HostingCFDomain
    errorstring
  • 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

NameIn
idpath

Request body

FieldType
tokenstring

Responses

  • 200 OK
    Body
    FieldType
    connectionStoreCloudflareConnection
    domains alwaysarray of HostingCFDomain
    errorstring
  • 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

NameIn
idpath
zidpath

Request body

FieldType
cf_account_idstring

Responses

  • 201 Created
    Body
    FieldType
    account_id alwaysstring
    cf_status alwaysstring
    cf_zone_id alwaysstring
    created_at alwaysinteger
    last_errorstring
    last_plan alwaysany
    last_sync_atinteger
    name_servers alwaysarray of string
    purge_on_deploy alwaysboolean
    ssl_strict alwaysboolean
    sync_status alwaysstring
    zone_id alwaysstring
    zone_name alwaysstring
  • 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

NameIn
idpath
zidpath

Request body

FieldType
purge_on_deployboolean
ssl_strictboolean

Responses

  • 200 OK
    Body
    FieldType
    purge_on_deployboolean
    ssl_strictboolean
  • 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

NameIn
idpath
zidpath
replacequery

Responses

  • 200 OK
    Body
    FieldType
    cf_status alwaysstring
    cf_zone_id alwaysstring
    mail_at_cloudflare alwaysboolean
    mail_notestring
    plan alwaysCloudflarePlan
    proxied alwaysinteger
    skipped alwaysarray of string
    zone alwaysstring
  • 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

NameIn
idpath
zidpath

Request body

FieldType
hostsarray 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

NameIn
idpath
zidpath

Responses

  • 200 OK
    Body
    FieldType
    addedinteger
    conflictsarray of CloudflareConflict
    removedinteger
    updatedinteger
  • 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