Welcome to our new docs! Please keep in mind we are still working on making everything is as accurate as possible. Join us on discord and ask us questions if you are unsure.
DezerX Spartan Logo
User

Create New User

Create a new user in the system using the UserRegistrationService

POST
/users
AuthorizationBearer <token>

Bearer token authentication

In: header

namestring
Lengthlength <= 255
emailstring
Formatemail
Lengthlength <= 255
passwordstring
Length8 <= length
role?string

Response Body

curl -X POST "https://serverpro.dezerx.com/api/application/users" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john@example.com",
    "password": "password123"
  }'
{
  "success": true,
  "message": "User created successfully",
  "data": {
    "id": 1,
    "role": "superadmin",
    "name": "John Doe",
    "email": "john@example.com",
    "avatar": "assets/default-avatar.png",
    "banner": null,
    "discord_id": null,
    "email_verified_at": null,
    "created_at": "2025-08-02T16:38:48.000000Z",
    "updated_at": "2025-08-02T16:38:48.000000Z",
    "admin_role": {
      "id": 1,
      "name": "superadmin",
      "display_name": "Super Administrator",
      "description": "Full system access - cannot be modified or deleted",
      "permissions": [
        "*"
      ],
      "is_system_role": true,
      "is_deletable": false,
      "created_at": "2025-08-02T16:38:31.000000Z",
      "updated_at": "2025-08-02T16:38:31.000000Z"
    },
    "services": [
      {
        "id": 11,
        "service_name": "DezerX",
        "product_id": 1,
        "category_id": 1,
        "owner_id": 1,
        "extra_owners": null,
        "price": "5.00",
        "original_price": null,
        "coupon_id": null,
        "has_lifetime_discount": false,
        "billing_cycle": "yearly",
        "due_date": "2026-08-02T17:52:20.000000Z",
        "payment_method": null,
        "recurring": null,
        "status": "active",
        "module": "LicenseService",
        "created_at": "2025-08-02T17:52:20.000000Z",
        "updated_at": "2025-08-02T17:54:38.000000Z",
        "last_reminded": null
      }
    ]
  }
}
{
  "error": "Unauthorized",
  "message": "Bearer token required"
}
{
  "error": "Forbidden",
  "message": "Insufficient permissions for this action"
}

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "name": [
      "The name field is required."
    ],
    "email": [
      "The email has already been taken."
    ],
    "role": [
      "The selected role is invalid."
    ],
    "password": [
      "The password must be at least 8 characters."
    ]
  }
}

{
  "success": false,
  "message": "Error creating user: Database connection failed"
}