Application API

Users API

GET/api/application/users

Fetching users

  • page
  • per_page
    • max is 100
  • filter[name]
  • filter[id]
  • filter[email]
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
    }
}

Updating a user

PUT /api/application/users/<user id>

  • Note: if you want to change the password, set it to a string instead of a null value
    • leave it as a null value if you want no change

Payload

JSON
{
    "root_admin": true,
    "name": "Mike Hawkk",
    "email": "[email protected]",
    "password": null
}

Returns

JSON
{
    "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

root_adminboolean
namestring
emailstring
passwordstring
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"