POST /auth/admin/signup
Create an admin (secret-key gated)
Create an admin (secret-key gated)
/auth/admin/signupRequest body
AdminSignupDto
| Field | Type | Required | Description |
|---|---|---|---|
email | string | required | Admin email address Example: admin@example.com |
password | string | required | Admin password (minimum 8 characters, must contain uppercase, lowercase, number, and special character) Example: SecurePassword123! |
secretKey | string | required | Secret key for authorization (provided in module configuration) Example: your-secret-key |
name | string | optional | Admin name (optional) Example: Admin User |
metadata | object | optional | Additional metadata for the admin user (optional) Example: {"department":"IT","role":"super-admin"} |
Examples
Example
{
"email": "admin@example.com",
"password": "SecurePassword123!",
"secretKey": "your-secret-key",
"name": "Admin User",
"metadata": {
"department": "IT",
"role": "super-admin"
}
}Responses
201
400Validation failed (bad input).
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}401Missing, invalid, or expired authentication.
ApiErrorResponseDto
| Field | Type | Required | Description |
|---|---|---|---|
statusCode | number | required | HTTP status code Example: 401 |
error | string | required | HTTP status text / exception name Example: Unauthorized |
message | string | required | Human-readable message Example: Invalid credentials |
code | string | required | Stable, machine-readable error code — branch on this, not the message Example: INVALID_CREDENTIALS |
Example response
{
"statusCode": 401,
"error": "Unauthorized",
"message": "Invalid credentials",
"code": "INVALID_CREDENTIALS"
}Try it
curl -X POST 'https://api.example.com/auth/admin/signup' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{"email":"admin@example.com","password":"SecurePassword123!","secretKey":"your-secret-key","name":"Admin User","metadata":{"department":"IT","role":"super-admin"}}'