Bootstrap admin
One-time initial admin creation for a fresh deployment (no auth; 403 once users exist). Request {email, name}; dev returns a temp password, used for first login with forced change.
Request
Content type: application/json · required
| Field | Type | Required | Description |
|---|---|---|---|
email |
string (email) | Yes | — |
name |
string | Yes | — |
password |
string | Yes | — |
curl -X POST "$MONICHEK_API/auth/bootstrap-admin" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "Ada Okafor",
"password": "<password>"
}'const res = await fetch(`${MONICHEK_API}/auth/bootstrap-admin`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"email": "[email protected]",
"name": "Ada Okafor",
"password": "<password>"
}),
});
const data = await res.json();import os
import requests
res = requests.post(
f"{os.environ['MONICHEK_API']}/auth/bootstrap-admin",
json={
"email": "[email protected]",
"name": "Ada Okafor",
"password": "<password>"
},
)
print(res.json())$ch = curl_init(getenv('MONICHEK_API') . '/auth/bootstrap-admin');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'name' => 'Ada Okafor',
'password' => '<password>',
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Responses
201 Created
admin created
application/json
{
"object": "user",
"user_id": "usr_01M3R...",
"email": "[email protected]",
"role": "admin"
}Error responses
| Status | Meaning | Body |
|---|---|---|
| 403 | Forbidden | RFC 9457 problem |
| 422 | Unprocessable Entity | RFC 9457 problem |
Errors use the RFC 9457 problem format with a stable code.