Application API

Users API

GET/api/application/users

Fetching users

Query parameters

pageinteger
The page to return.
per_pageinteger
Results per page. Defaults to 50; the most is 100.
filter[id]integer
The user with this ID.
filter[name]string
Users whose name contains this text, ignoring case.
filter[email]string
The user with this email address, ignoring case.
Request
GET/api/application/users
curl "https://panel.example.com/api/application/users" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json"
Response
{
    "data": [
        {
            "id": 1,
            "name": "Mike Hawk",
            "email": "[email protected]",
            "email_verified_at": null,
            "root_admin": true,
            "servers_count": 3
        },
        {
            "id": 7,
            "name": "Crystal Larson",
            "email": "[email protected]",
            "email_verified_at": "2022-12-10T20:55:51.000000Z",
            "root_admin": false,
            "servers_count": 0
        }
    ],
    "meta": {
        "pagination": {
            "total": 37,
            "count": 37,
            "per_page": 50,
            "current_page": 1,
            "total_pages": 1,
            "links": {}
        }
    }
}
GET/api/application/users/<id>

Fetching a user

Request
GET/api/application/users/<id>
curl "https://panel.example.com/api/application/users/<id>" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json"
Response
{
    "data": {
        "id": 1,
        "name": "Mike Hawk",
        "email": "[email protected]",
        "email_verified_at": null,
        "root_admin": true,
        "servers_count": 3
    }
}
PUT/api/application/users/<id>

Updating a user

Body parameters

namestringrequired
The user's name. 1 to 191 characters.
emailstringrequired
The user's email address. Must not belong to another user.
passwordstring or null
A new password of at least 8 characters. null, or leaving it out, keeps the current one.
root_adminbooleanrequired
true for an administrator, false for a regular user. Setting it to false on an administrator also deletes their API tokens.
Request
PUT/api/application/users/<id>
curl -X PUT "https://panel.example.com/api/application/users/<id>" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{
    "root_admin": true,
    "name": "Mike Hawkk",
    "email": "[email protected]",
    "password": null
  }'
Response
{
    "data": {
        "id": 1,
        "name": "Mike Hawkk",
        "email": "[email protected]",
        "email_verified_at": null,
        "root_admin": true,
        "servers_count": 3
    }
}
POST/api/application/users

Creating a user

Body parameters

namestringrequired
The user's name. 1 to 191 characters.
emailstringrequired
The user's email address. Must not belong to another user.
passwordstringrequired
The user's password. At least 8 characters.
root_adminbooleanrequired
true for an administrator, false for a regular user.
Request
POST/api/application/users
curl -X POST "https://panel.example.com/api/application/users" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  --data '{
    "root_admin": true,
    "name": "Anush K",
    "email": "[email protected]",
    "password": "qCG2xHoA^%@%g"
  }'
Response
{
    "data": {
        "id": 43,
        "name": "Anush K",
        "email": "[email protected]",
        "email_verified_at": null,
        "root_admin": true,
        "servers_count": 0
    }
}
DELETE/api/application/users/<id>

Deleting a user

  • Note: make sure that there are no servers associated with that server before deleting. If there are servers, a HTTP exception will be thrown and the action won't be processed.

Returns no content

Request
DELETE/api/application/users/<id>
curl -X DELETE "https://panel.example.com/api/application/users/<id>" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json"