Skip to content

Admin API: Password resets

An operation to send an email for setting a new password. Common rules (authentication, error format, dates and times) are in the Admin API reference.

In the examples, replace <hostname> with the hostname of your environment and <access token> with an access token that starts with hako_pat_. Replace other values in angle brackets, such as <slug>, with the values described in each operation’s parameter table.

Operation Method and path
Send a password reset email POST /admin/api/auth/password-reset

If the address is registered and within the sending limit, a password link is sent by email. If the address is not registered or the limit was reached, the same 202 is returned (so that nobody can tell whether the address is registered). If there are too many requests from the same IP, 429 is returned.

POST /admin/api/auth/password-reset
  • Login: not required

Request body (application/json):

Name Type Required Constraints Description
email string Yes Email address of the account whose password was forgotten

Responses:

Status Body Reason
202 object (application/json)
400 Error (application/json) The input values break the rules (including JSON syntax errors). Errors with their locations are in issues
415 Error (application/json) Content-Type: application/json is missing
422 Error (application/json) The JSON has the wrong shape (a required key is missing, a type is wrong, or there is an unknown key)
429 Error (application/json) Too many requests. Try again after the number of seconds in Retry-After

If the request fails, you get a 4xx or 5xx status and a JSON body with message. What each status means is in the error list.

Example:

ターミナルウィンドウ
curl -X POST "https://<hostname>.hakocms.net/admin/api/auth/password-reset" \
-H "Content-Type: application/json" \
-d '{
"email": "<email>"
}'