GET
/api/application/usersFetching users
- page
- per_page
- max is 100
- filter[name]
- filter[id]
- filter[email]
Request
GET
/api/application/userscurl "https://panel.example.com/api/application/users" \ -H "Authorization: Bearer <token>" \ -H "Accept: application/json"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->get('https://panel.example.com/api/application/users');
const response = await fetch('https://panel.example.com/api/application/users', { headers: { Authorization: `Bearer ${token}`, 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"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->get('https://panel.example.com/api/application/users/<id>');
const response = await fetch('https://panel.example.com/api/application/users/<id>', { headers: { Authorization: `Bearer ${token}`, 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/usersCreating a user
Body parameters
root_adminbooleannamestringemailstringpasswordstring
Request
POST
/api/application/userscurl -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" }'
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->post('https://panel.example.com/api/application/users', [ 'root_admin' => true, 'name' => 'Anush K', 'email' => '[email protected]', 'password' => 'qCG2xHoA^%@%g', ]);
const response = await fetch('https://panel.example.com/api/application/users', { method: 'POST', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ "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"
use Illuminate\Support\Facades\Http; $response = Http::withToken($token) ->acceptJson() ->delete('https://panel.example.com/api/application/users/<id>');
const response = await fetch('https://panel.example.com/api/application/users/<id>', { method: 'DELETE', headers: { Authorization: `Bearer ${token}`, Accept: 'application/json', }, })