Replace a site's HTTP authentication
Replaces the whole set of rules and users, so start from the last read and keep the id of every rule and user you want to keep. The passwords this save set or generated are answered once, in credentials.
- Needs
execas well: A user in the body asks for a generated password (generateis true).
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
Whether the whole environment asks for a login. True needs a whole-environment rule (path_prefix null) with at least one user, and that rule's own enabled must say the same.
Up to 20 items.
Fields of each item
A saved rule's id, to keep it. Leave it out, or send null, for a new rule.
Null for the whole environment. Otherwise a path that starts with / and contains only letters, digits, -, _, . and /. Up to 200 characters.
Up to 10 items.
Fields of each item
Ask the Control Panel to generate the password. A new user needs password or generate, never both; a saved user sent with neither keeps its password. Defaults to false.
A saved user's id, to keep it. Leave it out, or send null, for a new user.
A password you choose: at least 12 characters and at most 72 bytes as UTF-8 (so fewer than 72 characters when it has characters outside ASCII), with at least one letter and one digit and no control characters. It cannot be the username, the site's main domain or its platform address.
Lower-case letters, digits, dots, dashes and underscores, 3 to 32 characters. The first and the last character are a letter or a digit.
The version of the last read. At least 0.
Returns
200 The set sent is the set the site already has. Nothing was started.
201 The set was saved and is being applied. Follow operation.id until it completes. credentials lists the passwords this save set or generated; the answer is sent with Cache-Control: no-store, private.
Fields of the 200 answer
The passwords this save set or generated. Shown once.
Fields of each item
Format: date-time.
At least 1.
At least 1.
Fields
Whether a saved set of rules is live on the site.
Fields
Sent only by the sets that have more to say, such as HTTP authentication.
The change that is applying the set, while one is running.
Such as applied or applying.
How many of Corefinity's own addresses are let past HTTP authentication.
Always empty for you. Corefinity's own addresses are let past HTTP authentication and are told to Corefinity staff only; bypass_corefinity counts them.
Whether an environment with this role starts protected.
Whether the whole environment asks for a login.
Fields
Fields of each item
At least 1.
The path the rule protects. Null for the whole environment.
Fields of each item
Format: date-time.
At least 1.
When the password was last revealed. Format: date-time.
Fields of the 201 answer
The passwords this save set or generated. Shown once.
Fields of each item
Format: date-time.
At least 1.
At least 1.
Fields
Whether a saved set of rules is live on the site.
Fields
Sent only by the sets that have more to say, such as HTTP authentication.
The change that is applying the set, while one is running.
Such as applied or applying.
How many of Corefinity's own addresses are let past HTTP authentication.
Always empty for you. Corefinity's own addresses are let past HTTP authentication and are told to Corefinity staff only; bypass_corefinity counts them.
Whether an environment with this role starts protected.
Whether the whole environment asks for a login.
Fields
Fields of each item
At least 1.
The path the rule protects. Null for the whole environment.
Fields of each item
Format: date-time.
At least 1.
When the password was last revealed. Format: date-time.
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. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | cluster_paused | Changes on this site are paused for planned maintenance; please try again later. |
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 | legacy_adopt_pending | HTTP authentication is being prepared for the site and is not available yet. Try again later. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
409 | stale | What you read has changed since you read it. Read it again, then send the change with its new version or quote. |
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 PUT https://manage.corefinity.com/api/corestack/sites/1042/http-auth \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"rules": [
{
"enabled": true,
"path_prefix": "/wp-admin/",
"users": [
{
"password": "Example-editor-2026",
"username": "editor"
}
]
}
],
"version": 0
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/corestack/sites/1042/http-auth', [
'enabled' => false,
'rules' => [
[
'enabled' => true,
'path_prefix' => '/wp-admin/',
'users' => [
[
'password' => 'Example-editor-2026',
'username' => 'editor',
],
],
],
],
'version' => 0,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/http-auth', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
enabled: false,
rules: [
{
enabled: true,
path_prefix: '/wp-admin/',
users: [
{
password: 'Example-editor-2026',
username: 'editor',
},
],
},
],
version: 0,
}),
});
// 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.put(
"https://manage.corefinity.com/api/corestack/sites/1042/http-auth",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"enabled": False,
"rules": [
{
"enabled": True,
"path_prefix": "/wp-admin/",
"users": [
{
"password": "Example-editor-2026",
"username": "editor",
},
],
},
],
"version": 0,
},
)
data = res.json() if res.content else None{
"credentials": [],
"http_auth": {
"apply": {
"applied_at": null,
"error": null,
"operation": null,
"state": "applied",
"state_label": "Applied"
},
"bypass_corefinity": 1,
"bypass_ips": [],
"default_for_role": false,
"enabled": false,
"limits": {
"prefix_max": 200,
"rules_max": 20,
"users_per_rule_max": 10
},
"note": "Passwords are stored encrypted and shown only when you reveal them; every reveal is recorded.",
"rules": [],
"version": 0
},
"operation": null
}{
"credentials": [
{
"password": "Example-editor-2026",
"revealed_at": "2026-11-06T15:00:00Z",
"rule_id": 52,
"user_id": 74,
"username": "editor"
}
],
"http_auth": {
"apply": {
"applied_at": null,
"detail": {
"credentials": "pending"
},
"error": null,
"operation": {
"id": 431,
"scope": "site",
"status": "executing",
"status_label": "Applying",
"summary": "HTTP authentication: 1 rule, 1 user",
"to_version": null,
"type": "http_auth_change",
"type_label": "HTTP authentication"
},
"state": "applying",
"state_label": "Applying"
},
"bypass_corefinity": 1,
"bypass_ips": [],
"default_for_role": false,
"enabled": false,
"limits": {
"prefix_max": 200,
"rules_max": 20,
"users_per_rule_max": 10
},
"note": "Passwords are stored encrypted and shown only when you reveal them; every reveal is recorded.",
"rules": [
{
"enabled": true,
"id": 52,
"path_prefix": "/wp-admin/",
"sort": 0,
"users": [
{
"created_at": "2026-11-06T15:00:00Z",
"id": 74,
"password_set": true,
"revealed_at": null,
"username": "editor"
}
]
}
],
"version": 1
},
"operation": {
"completed_at": null,
"created_at": "2026-11-06T15:00:00Z",
"error": null,
"id": 431,
"scope": "site",
"status": "executing",
"status_label": "Applying",
"steps": [
{
"key": "saved",
"label": "Saved",
"state": "done"
},
{
"key": "credentials",
"label": "Password live",
"state": "current"
}
],
"type": "http_auth_change",
"type_label": "HTTP authentication"
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "invalid",
"errors": {
"enabled": [
"Add at least one user for the whole-environment rule"
]
},
"field": "enabled",
"message": "Add at least one user for the whole-environment rule",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "The platform returned an error (HTTP 503). Try again shortly."
}Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.