Skip to content

Reset the WordPress administrator's password

POST /v1/sites/{siteId}/actions/reset-admin-password

Sets a new random password for the WordPress administrator made with the site, and answers the login with it. The old password stops working at once. The site must be live and its server running.

Scopes

The token needs these scopes. Without them, the request is refused with insufficient_scope (see Scopes).

sites:write
Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.
sites:files
Files and logins. File Manager, WordPress logins, cron jobs, backup downloads and backup storage. Full access to the sites' code and data.

Headers

FieldType and description
Idempotency-Key

string 1 to 255 characters

A key of your own for this request, like a UUID: letters, digits and _ - : . Send the request again with the same key (after a timeout, say) and it's done only once. Keys are kept for 24 hours (see Idempotency).

Path parameters

FieldType and description
siteId Required

string

The site's id.

Example request

curl -X POST "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/actions/reset-admin-password" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN"

Response

200 OK Returns the WordPressLogin object in data.

The WordPressLogin object's fields 3 fields
FieldType and description
username

string

The WordPress administrator's username.

email

string

The administrator's email address.

password

string or null

The administrator's password as Rabbitflare set it. Null when it can't be read (reset it to get a new one).

Example response

200 OK
{
  "data": {
    "username": "editor",
    "email": "[email protected]",
    "password": "b7Rk2mQx9TzLp4WnVh3s"
  }
}

Errors

The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).

Status and codeWhen, and what to do
403 trial_locked

The site's server is on the free trial: WordPress sign-in, the File Manager and Cron Jobs switch on once it's kept.

Keep the server in the control panel: they switch on by themselves.

404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 busy

Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): message says what.

Wait until it finishes, then try again. A change to the server or site itself is done when its pendingAction is null again; for anything else, message says how long to wait.

409 invalid_state

The resource's status doesn't allow this now (for example, powering on a server that is running). message says why.

Check the resource's status, then do what message says.

409 server_unavailable

The server isn't in a state that allows this (for example, it's off or still being set up).

Start the server, or wait until it's active, then try again.

409 staging_busy

A staging operation is running on this site, or on a site of this server.

Wait until it finishes (activeRun in GET /sites/{siteId}/staging is null again), or cancel it, then try again.

409 clone_busy

A clone of this site, or of a site on this server, is being made.

Wait until the clone finishes (or cancel it), then try again.

409 server_restoring

The server is being restored, and nothing else can change it or its sites until that's done.

Wait until the restore finishes (the server's pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

502 server_unreachable

The server didn't answer, or didn't finish the request.

Check that the server is running, then try again in a minute.

502 server_error

The server answered, but not as expected.

Try again in a minute. If it keeps happening, contact support with the request id.

Rate limit

Heavy requests: 20 a minute per token, 40 per account. More in Rate limits.

Added on .

Popular

API docs