CorefinityCorefinityDocs
Open the Control PanelControl Panel
Password protection · 3 of 4

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.

PUT/api/corestack/sites/{site}/http-auth
  • Needs exec as well: A user in the body asks for a generated password (generate is true).

Path parameters

siteintegerRequired

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

enabledbooleanRequired

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.

rulesarray of objectsRequired

Up to 20 items.

Fields of each item
enabledbooleanRequired
idinteger or null

A saved rule's id, to keep it. Leave it out, or send null, for a new rule.

path_prefixstring or nullRequired

Null for the whole environment. Otherwise a path that starts with / and contains only letters, digits, -, _, . and /. Up to 200 characters.

usersarray of objectsRequired

Up to 10 items.

Fields of each item
generateboolean

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.

idinteger or null

A saved user's id, to keep it. Leave it out, or send null, for a new user.

passwordstring or null

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.

usernamestringRequired

Lower-case letters, digits, dots, dashes and underscores, 3 to 32 characters. The first and the last character are a letter or a digit.

versionintegerRequired

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
credentialsarray of objectsRequired

The passwords this save set or generated. Shown once.

Fields of each item
passwordstringRequired
revealed_atstringRequired

Format: date-time.

rule_idintegerRequired

At least 1.

user_idintegerRequired

At least 1.

usernamestringRequired
http_authobjectRequired
Fields
applyobjectRequired

Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
bypass_corefinityintegerRequired

How many of Corefinity's own addresses are let past HTTP authentication.

bypass_ipsarray of stringsRequired

Always empty for you. Corefinity's own addresses are let past HTTP authentication and are told to Corefinity staff only; bypass_corefinity counts them.

default_for_rolebooleanRequired

Whether an environment with this role starts protected.

enabledbooleanRequired

Whether the whole environment asks for a login.

limitsobjectRequired
Fields
prefix_maxintegerRequired
rules_maxintegerRequired
users_per_rule_maxintegerRequired
notestringRequired
rulesarray of objectsRequired
Fields of each item
enabledbooleanRequired
idintegerRequired

At least 1.

path_prefixstring or nullRequired

The path the rule protects. Null for the whole environment.

sortintegerRequired
usersarray of objectsRequired
Fields of each item
created_atstring or nullRequired

Format: date-time.

idintegerRequired

At least 1.

password_setbooleanRequired
revealed_atstring or nullRequired

When the password was last revealed. Format: date-time.

usernamestringRequired
versionintegerRequired
operationobject or any or nullRequired
Fields of the 201 answer
credentialsarray of objectsRequired

The passwords this save set or generated. Shown once.

Fields of each item
passwordstringRequired
revealed_atstringRequired

Format: date-time.

rule_idintegerRequired

At least 1.

user_idintegerRequired

At least 1.

usernamestringRequired
http_authobjectRequired
Fields
applyobjectRequired

Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
bypass_corefinityintegerRequired

How many of Corefinity's own addresses are let past HTTP authentication.

bypass_ipsarray of stringsRequired

Always empty for you. Corefinity's own addresses are let past HTTP authentication and are told to Corefinity staff only; bypass_corefinity counts them.

default_for_rolebooleanRequired

Whether an environment with this role starts protected.

enabledbooleanRequired

Whether the whole environment asks for a login.

limitsobjectRequired
Fields
prefix_maxintegerRequired
rules_maxintegerRequired
users_per_rule_maxintegerRequired
notestringRequired
rulesarray of objectsRequired
Fields of each item
enabledbooleanRequired
idintegerRequired

At least 1.

path_prefixstring or nullRequired

The path the rule protects. Null for the whole environment.

sortintegerRequired
usersarray of objectsRequired
Fields of each item
created_atstring or nullRequired

Format: date-time.

idintegerRequired

At least 1.

password_setbooleanRequired
revealed_atstring or nullRequired

When the password was last revealed. Format: date-time.

usernamestringRequired
versionintegerRequired
operationobject or any 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.
409busyAnother operation is running on the site. Wait for it to finish.
409cluster_pausedChanges on this site are paused for planned maintenance; please try again later.
409deletedThe 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.
409legacy_adopt_pendingHTTP authentication is being prepared for the site and is not available yet. Try again later.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
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 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
  }'
{
  "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
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT