Skip to main content
Server Actions

Enable Basic Auth on a stack server

Asynchronous Request

Runs the Enable Basic Auth script on a LAMP/LEMP stack server. Use / to protect the whole site, or a path like /admin or /wp-login. A protected path also protects subpaths (for example /admin/users), but not similar prefixes (for example /administrator). Add or update one path per request; each path can have its own credentials.

POST
/servers/{serverSlug}/actions/enable-basic-auth
Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

serverSlugstringrequired

Slug of the server

Body

application/json
passwordstringrequired

Basic Auth password for this path. Any printable characters are allowed (max 72 bytes; control characters and line breaks are rejected).

Example: staging123
pathstringrequired

URL path to protect. Use / for the whole site, or a specific path like /admin. Protects that path and its subpaths only.

Example: /admin
usernamestringrequired

Basic Auth username for this path.

Example: staging

Enable Basic Auth initiated.

X-Callback-IDstringheader

CallbackID