CorefinityCorefinityDocs
Open the Control PanelControl Panel
Cloudflare · 2 of 10

Connect Cloudflare

Checks a Cloudflare API token with Cloudflare and stores it encrypted for your company. Connecting again replaces the token and keeps every site's zone.

POST/api/corestack/company/cloudflare

Body

tokenstringRequired

A Cloudflare API token. Printable characters without spaces. Up to 128 characters.

Returns

200 The connection as it is now.

Fields of the 200 answer
can_changebooleanRequired
companyobjectRequired
Fields
idintegerRequired

At least 1.

namestringRequired
connectobjectRequired

A link to Cloudflare's token form and the steps to follow.

Fields
instructionsarray of stringsRequired
urlstringRequired
connected_byobject or any or nullRequired

Who connected it. Null when it is not known. Corefinity staff read as Corefinity support with a null id.

last_errorstring or nullRequired
methodstring or nullRequired
scopesobjectRequired

The permissions the token needs (required) and those it lacks (missing).

Fields
missingarray of stringsRequired
requiredarray of stringsRequired
statusstringRequired
not_connectedverifyingconnectedinvalidneeds_reauth
status_labelstringRequired
token_idstring or nullRequired
token_last4string or nullRequired

The last four characters of the token.

unmapped_sitesarray of objects or nullRequired

Sites whose domain is in none of the zones, each with id and domain.

verified_atstring or nullRequired

Format: date-time.

zonesarray of objectsRequired
Fields of each item
dns01object or nullRequired
idstringRequired

Cloudflare's id for the zone. Send it as zone_id.

namestringRequired
permissionsobjectRequired

What the token may do in the zone.

Fields
cache_purgebooleanRequired
dns_editbooleanRequired
zone_settingsbooleanRequired
planstring or nullRequired
refreshed_atstring or nullRequired

Format: date-time.

sitesarray of objectsRequired

The sites mapped to the zone.

Fields of each item
mappingstringRequired

Whether the Control Panel matched the zone to the site or you chose it.

automanual
siteobjectRequired
Fields
domainstringRequired
idintegerRequired

At least 1.

ssl_modestring or nullRequired
ssl_okboolean or nullRequired
ssl_recommendedstring or nullRequired
statusstring or nullRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/company/cloudflare \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "token": "example-cloudflare-api-token-0000000000000000"
  }'
{
  "can_change": true,
  "company": {
    "id": 1204,
    "name": "Harbour & Finch"
  },
  "connect": {
    "instructions": [
      "Open the token form in Cloudflare. It opens with the permissions the Control Panel needs already chosen."
    ],
    "url": "https://dash.cloudflare.com/profile/api-tokens"
  },
  "connected_by": {
    "id": 5021,
    "name": "Eleanor Finch"
  },
  "last_error": null,
  "method": "api_token",
  "scopes": {
    "missing": [],
    "required": [
      "Zone:Read",
      "DNS:Edit",
      "Cache Purge:Purge",
      "Zone Settings:Read",
      "Zone Settings:Edit"
    ]
  },
  "status": "connected",
  "status_label": "Connected",
  "token_id": "c0ffee000000000000000000f1c7e912",
  "token_last4": "0000",
  "unmapped_sites": [],
  "verified_at": "2026-11-02T12:02:30Z",
  "zones": [
    {
      "dns01": null,
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "harbourandfinch.example.com",
      "permissions": {
        "cache_purge": true,
        "dns_edit": true,
        "zone_settings": true
      },
      "plan": "Free",
      "refreshed_at": "2026-11-06T03:00:14Z",
      "sites": [
        {
          "mapping": "auto",
          "site": {
            "domain": "harbourandfinch.example.com",
            "id": 1042
          }
        }
      ],
      "ssl_mode": "full",
      "ssl_ok": false,
      "ssl_recommended": "strict",
      "status": "active"
    }
  ]
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT