Create User with Application API

Create a new user.

Usage

<?php
    $pterodactyl->createUser(array $data);
?>

Parameters

Parameter Description Rules
data The data to create user

data

Parameter Description Rules
external_id External id sometimes|nullable|string|max:255|unique:users,external_id
email Email address sometimes|email|unique:users,email
username User name required|between:1,255|unique:users,username
password Password sometimes|nullable|string
language Language required|string
root_admin Whether root admin or not boolean
first_name First name required|string|between:1,255
last_name Last name required|string|between:1,255

Returns

Returns a user instance.

{
    "id": 29,
    "externalId": null,
    "uuid": "ba8be618-e3e1-4495-aff3-6a2075e98fe3",
    "username": "testuser",
    "email": "test@panel.com",
    "firstName": "Test",
    "lastName": "User",
    "language": "en",
    "rootAdmin": false,
    "createdAt": "2019-12-11T10:47:19+00:00",
    "updatedAt": "2019-12-11T10:47:19+00:00",
    "object": "user",
    "meta": {
        "resource": "https:\/\/panel.pterodactyl\/api\/application\/users\/29"
    },
    "2fa": false
}

Example

<?php
    $user = $pterodactyl->createUser([
        'email' => 'test@panel.com',
        'username' => 'testuser',
        'password' => 'thepassword',
        'language' => 'en',
        'root_admin' => false,
        'first_name' => 'Test',
        'last_name' => 'User'
    ]);
    print_r($user);
?>