Skip to main content

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

HeaderTypeRequiredDescription
x-bootstrap-tokenstringYesBootstrap token for initial admin setup
Content-TypestringYesapplication/json

Request Body

{
"email": "admin@example.com",
"password": "securePassword123",
"roles": ["super-admin"]
}

Body Parameters

ParameterTypeRequiredDescription
emailstringYesAdmin email address (must be valid email format)
passwordstringYesAdmin password (minimum 12 characters)
rolesarrayNoArray 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