Create the first admin account
POST/setup/admin
Required role: none. This operation needs no credential.
Example request
curl --request POST \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/setup/admin"
Reachable only before an admin exists; refused once one does. Creating the admin is atomic — a race between two concurrent requests can never create two admins. Signs the new admin in on success, exactly like login, including the X-Hoserva-Session-Secret response header.
Request
Responses
- 200
- default
The admin account, now signed in.
Response Headers
Set-Cookie
X-Hoserva-Session-Secret
The session's second secret. A client keeps it in memory or session storage, never in a cookie, and sends it back as the X-Hoserva-Session-Secret request header on every request that authenticates with the session cookie.
An error response.