API Key
To authenticate with the Pterodactyl API, you need to use an API key. Include this key in the `Authorization` header as follows:
Authorization: Bearer YOUR_API_KEY
The Pterodactyl API allows you to interact with the Pterodactyl Panel programmatically. Below is a simplified guide to using the API endpoints.
To authenticate with the Pterodactyl API, you need to use an API key. Include this key in the `Authorization` header as follows:
Authorization: Bearer YOUR_API_KEY
GET /api/client/servers
{
"data": [
{
"id": "server_id",
"name": "Server Name",
"description": "Description of the server",
"status": "online"
}
]
}
GET /api/client/servers/{id}
{
"data": {
"id": "server_id",
"name": "Server Name",
"description": "Description of the server",
"status": "online",
"resources": {
"cpu": "75%",
"memory": "512MB",
"disk": "10GB"
}
}
}
POST /api/client/servers/{id}/power
Content-Type: application/json
{
"action": "start" // or "stop", "restart"
}
{
"status": "success",
"message": "Power action executed."
}
GET /api/application/eggs/{id}
{
"data": {
"id": "egg_id",
"name": "Egg Name",
"description": "Description of the egg",
"variables": {
"key": "value"
}
}
}
GET /api/application/users/{id}
{
"data": {
"id": "user_id",
"username": "Username",
"email": "user@example.com",
"role": "admin"
}
}