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.
Body
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
Fields
At least 1.
A link to Cloudflare's token form and the steps to follow.
Fields
Who connected it. Null when it is not known. Corefinity staff read as Corefinity support with a null id.
The permissions the token needs (required) and those it lacks (missing).
Fields
not_connectedverifyingconnectedinvalidneeds_reauthThe last four characters of the token.
Sites whose domain is in none of the zones, each with id and domain.
Format: date-time.
Fields of each item
Cloudflare's id for the zone. Send it as zone_id.
What the token may do in the zone.
Fields
Format: date-time.
The sites mapped to the zone.
Fields of each item
Whether the Control Panel matched the zone to the site or you chose it.
automanualFields
At least 1.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read 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"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/company/cloudflare', [
'token' => 'example-cloudflare-api-token-0000000000000000',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/company/cloudflare', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: 'example-cloudflare-api-token-0000000000000000',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/company/cloudflare",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"token": "example-cloudflare-api-token-0000000000000000",
},
)
data = res.json() if res.content else None{
"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"
}
]
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "invalid",
"errors": {
"token": [
"This token is not valid. Check it was copied in full"
]
},
"field": "token",
"message": "This token is not valid. Check it was copied in full",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "Cloudflare could not be reached"
}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.