Skip to content

Admin API: Password links

Operations to check the contents of a link received by email and set a 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
Contents of a password link GET /admin/api/password-links/{token}
Set a password with a link POST /admin/api/password-links/{token}
GET /admin/api/password-links/{token}
  • Login: not required

Parameters:

Name In Type Required Constraints Description
token path string Yes Token of the link

Responses:

Status Body Reason
200 PasswordLinkInfo (application/json)
404 Error (application/json) Not found

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 "https://<hostname>.hakocms.net/admin/api/password-links/<token>"

Sets the password. Other sessions are deleted, and you are logged in right away.

POST /admin/api/password-links/{token}
  • Login: not required

Parameters:

Name In Type Required Constraints Description
token path string Yes Token of the link

Request body (application/json):

Name Type Required Constraints Description
password string Yes

Responses:

Status Body Reason
200 MeResponse (application/json)
400 Error (application/json) The input values break the rules (including JSON syntax errors). Errors with their locations are in issues
404 Error (application/json) Not found
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)

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/password-links/<token>" \
-H "Content-Type: application/json" \
-d '{
"password": "<password>"
}'