---
title: "Update an SSL rule for domains"
url: https://docs.corefinity.com/api/reference/domains/update-site-cloudflare-ssl-rule
type: endpoint
last_updated: 2026-11-13
feature: cloudflare
related:
  - https://docs.corefinity.com/guides/sites/go-live/cloudflare-for-a-site.md
  - https://docs.corefinity.com/mcp/tools/corestack_site_cloudflare_ssl_rule_set.md
---
# Update an SSL rule for domains

Sets Full or Full (strict) for the named domains of the site, in their Cloudflare zone, and leaves the zone's own SSL mode as it is. The same rule asked for twice is one rule.

```http
POST /api/corestack/sites/{site}/cloudflare/ssl-rules
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 6 a minute; 60 an hour for each company
- Try it in the console: off. It has not been cleared for the console. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Body

- `hosts` (array of strings, required): Domains of this site, all in one connected Cloudflare zone of your company. Together they must fit one rule: the lengths of the names added up, plus three for each name, come to at most 4,080 characters. A longer list is refused `invalid` on `hosts`; set the names in two rules.
- `ssl` (string, required): `full` for Full, `strict` for Full (strict). One of `full`, `strict`.

## Request

### curl

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/ssl-rules \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "hosts": [
      "harbourandfinch.example.com",
      "www.harbourandfinch.example.com"
    ],
    "ssl": "full"
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->post('https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/ssl-rules', [
        'hosts' => [
            'harbourandfinch.example.com',
            'www.harbourandfinch.example.com',
        ],
        'ssl' => 'full',
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/ssl-rules', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    hosts: [
      'harbourandfinch.example.com',
      'www.harbourandfinch.example.com',
    ],
    ssl: 'full',
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.post(
    "https://manage.corefinity.com/api/corestack/sites/1042/cloudflare/ssl-rules",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "hosts": [
            "harbourandfinch.example.com",
            "www.harbourandfinch.example.com",
        ],
        "ssl": "full",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The rule, as Cloudflare now has it.

```json
{
  "rule": {
    "hosts": [
      "harbourandfinch.example.com",
      "www.harbourandfinch.example.com"
    ],
    "id": 318,
    "removed_at": null,
    "set_at": "2026-11-03T09:16:40+00:00",
    "site_id": 1042,
    "ssl": "full",
    "state": "active",
    "state_reason": null,
    "zone": {
      "id": "zone-example-1",
      "name": "harbourandfinch.example.com"
    }
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 Cloudflare is not connected (`not_connected`), the site or the token has no zone to use (`no_zone`), the same rule is being changed (`busy`), the rule was changed in Cloudflare while it was being set and so was left (`rule_edited`, with the `rule`), the site is deleted or still being created (`deleted`, `provisioning`), or another control panel manages it (`managed_elsewhere`).

```json
{
  "code": "busy",
  "message": "This SSL rule is being changed. Try again in a moment.",
  "reason": "busy"
}
```

### 422 A field is missing or wrong, or Cloudflare refused the rule as written (`invalid`); the Cloudflare token may not change Configuration Rules, or Cloudflare did not say whether it may (`rules_not_allowed`); or Cloudflare refused the stored token (`not_connected`). Nothing was written.

```json
{
  "code": "rules_not_allowed",
  "message": "Cloudflare did not say whether the token may change Configuration Rules on harbourandfinch.example.com, so nothing was written. Check the token's permissions, then try again.",
  "reason": "rules_not_allowed"
}
```

### 429 Too many requests (`rate_limited`): the endpoint's request limit, or your company's 60 Cloudflare changes this hour, which the Control Panel and AI assistants spend too. Wait for `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many Cloudflare changes this hour. Try again later.",
  "reason": "rate_limited",
  "retry_after_seconds": 3600
}
```

### 502 Cloudflare did not answer or did not confirm the change (`unavailable`). `rule` is sent when a rule was recorded: read the list again to see where it stands.

```json
{
  "code": "unavailable",
  "message": "Cloudflare did not answer. Try again in a minute.",
  "reason": "unavailable"
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | 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. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `no_zone` | The site's domain is not in a connected Cloudflare zone, or Cloudflare is off for the site. Connect the Cloudflare account that holds the zone. |
| 409 | `deleted` | The site, environment or copy has been deleted, or is being deleted. Nothing can be changed on it. Restore a deleted site first if it can still be restored. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `not_connected` | The outside account this needs is not connected for your company. Connect it first; the message names it. |
| 409 | `provisioning` | The site is still being created. Try again in a few minutes. |
| 409 | `rule_edited` | The Cloudflare rule was changed in Cloudflare after the Control Panel set it, so it was left as it is. Change or remove it in Cloudflare. |
| 422 | `rules_not_allowed` | The Cloudflare token may not change the zone's rules. Allow Zone, Config Rules, Edit on the token, or connect one that can. |
| 422 | `invalid` | Fix the field named in `field`; `errors` says why. |
| 422 | `not_connected` | The outside account this needs is not connected for your company. Connect it first; the message names it. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 502 | `unavailable` | This is not available for the site or environment, or not at the moment. Read the message; try again later where it says so, or contact support. |

## The same task elsewhere

- Guide: [Cloudflare for a site](https://docs.corefinity.com/guides/sites/go-live/cloudflare-for-a-site.md)
- MCP tool: [`corestack_site_cloudflare_ssl_rule_set`](https://docs.corefinity.com/mcp/tools/corestack_site_cloudflare_ssl_rule_set.md)
