Admin Bootstrap (v1)
Method + Path
POST /v1/auth/admin/bootstrap
Actual backend path: /v1/auth/admin/bootstrap
Description
Create the initial admin account. This endpoint is used only once during system setup to create the first admin user.
Authentication
Required - Bootstrap token in x-bootstrap-token header
caution
This endpoint requires a bootstrap token and should only be used during initial system setup.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
x-bootstrap-token | string | Yes | Bootstrap token for initial admin setup |
Content-Type | string | Yes | application/json |
Request Body
{
"email": "admin@example.com",
"password": "securePassword123",
"roles": ["super-admin"]
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Admin email address (must be valid email format) |
password | string | Yes | Admin password (minimum 12 characters) |
roles | array | No | Array of admin roles. Valid values: super-admin, admin |
Response (201)
{
"admin": {
"id": "507f1f77bcf86cd799439011",
"email": "admin@example.com",
"roles": ["super-admin"],
"createdAt": "2024-01-15T10:00:00Z"
}
}
Common Errors
- 400 Bad Request: Invalid request body or validation errors
- 403 Forbidden: Invalid or missing bootstrap token
- 409 Conflict: Admin account already exists
- 422 Unprocessable Entity: Validation errors (e.g., password too short, invalid email)
- 500 Internal Server Error: Server error