> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/pterodactyl/panel/llms.txt
> Use this file to discover all available pages before exploring further.

# Eggs

> Retrieve egg configurations and variables

The Eggs API allows you to retrieve information about eggs, which are the configuration templates for specific game server types (e.g., Vanilla Minecraft, Spigot, Paper, etc.).

<Info>
  Eggs are read-only via the API. They cannot be created, updated, or deleted through the API. Eggs are managed through the admin panel or imported from external sources.
</Info>

## What is an Egg?

An egg contains all the configuration needed to run a specific type of game server:

* Docker images to use
* Startup command
* Installation script
* Configuration file templates
* Environment variables
* Resource requirements

## List Eggs

Eggs are accessed through their parent nest. See [Nests](/api/application/nests#list-nest-eggs) for listing eggs.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://panel.example.com/api/application/nests/{nest_id}/eggs" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```
</CodeGroup>

## Get Egg Details

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://panel.example.com/api/application/nests/{nest_id}/eggs/{egg_id}" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```
</CodeGroup>

Retrieves detailed information about a specific egg.

### Path Parameters

<ParamField path="nest_id" type="integer" required>
  The internal ID of the nest
</ParamField>

<ParamField path="egg_id" type="integer" required>
  The internal ID of the egg
</ParamField>

### Query Parameters

<ParamField query="include" type="string">
  Include related resources. Available: `nest`, `servers`, `config`, `script`, `variables`
</ParamField>

### Response

<ResponseField name="object" type="string">
  Always `egg`
</ResponseField>

<ResponseField name="attributes" type="object">
  <Expandable title="Egg Attributes">
    <ResponseField name="id" type="integer">
      Internal egg ID
    </ResponseField>

    <ResponseField name="uuid" type="string">
      Unique identifier for the egg
    </ResponseField>

    <ResponseField name="name" type="string">
      Display name of the egg
    </ResponseField>

    <ResponseField name="nest" type="integer">
      ID of the parent nest
    </ResponseField>

    <ResponseField name="author" type="string">
      Email address of the egg author
    </ResponseField>

    <ResponseField name="description" type="string | null">
      Description of the egg
    </ResponseField>

    <ResponseField name="docker_image" type="string">
      Default Docker image (deprecated, use `docker_images`)
    </ResponseField>

    <ResponseField name="docker_images" type="object">
      Available Docker images (key-value pairs of name and image)
    </ResponseField>

    <ResponseField name="config" type="object">
      Configuration settings

      <Expandable title="Config Object">
        <ResponseField name="files" type="object">
          Configuration file templates
        </ResponseField>

        <ResponseField name="startup" type="object">
          Startup detection configuration
        </ResponseField>

        <ResponseField name="stop" type="string">
          Command to stop the server
        </ResponseField>

        <ResponseField name="logs" type="object">
          Log file configuration
        </ResponseField>

        <ResponseField name="file_denylist" type="array">
          List of files users cannot edit
        </ResponseField>

        <ResponseField name="extends" type="integer | null">
          ID of egg this extends for config
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="startup" type="string">
      Server startup command with variable placeholders
    </ResponseField>

    <ResponseField name="script" type="object">
      Installation script configuration

      <Expandable title="Script Object">
        <ResponseField name="privileged" type="boolean">
          Whether the installation requires privileged mode
        </ResponseField>

        <ResponseField name="install" type="string">
          Installation script content
        </ResponseField>

        <ResponseField name="entry" type="string">
          Script entry point (e.g., "bash")
        </ResponseField>

        <ResponseField name="container" type="string">
          Docker image for installation
        </ResponseField>

        <ResponseField name="extends" type="integer | null">
          ID of egg this extends for script
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "object": "egg",
    "attributes": {
      "id": 1,
      "uuid": "3c8e9d6f-4d5c-6e0f-af3h-1c5d6e7f8g9h",
      "name": "Vanilla Minecraft",
      "nest": 1,
      "author": "support@pterodactyl.io",
      "description": "Minecraft is a game about placing blocks and going on adventures.",
      "docker_image": "ghcr.io/pterodactyl/yolks:java_17",
      "docker_images": {
        "Java 17": "ghcr.io/pterodactyl/yolks:java_17",
        "Java 11": "ghcr.io/pterodactyl/yolks:java_11",
        "Java 8": "ghcr.io/pterodactyl/yolks:java_8"
      },
      "config": {
        "files": {
          "server.properties": {
            "parser": "properties",
            "find": {
              "server-ip": "0.0.0.0",
              "server-port": "{{server.build.default.port}}",
              "query.port": "{{server.build.default.port}}"
            }
          }
        },
        "startup": {
          "done": ")! For help, type "
        },
        "stop": "stop",
        "logs": {},
        "file_denylist": [],
        "extends": null
      },
      "startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
      "script": {
        "privileged": true,
        "install": "#!/bin/bash\n# Vanilla MC Installation Script\napt update\napt install -y curl jq\n\ncd /mnt/server\n\nVERSION=${VANILLA_VERSION}\n\nif [ \"${VERSION}\" == \"latest\" ]; then\n    VERSION=$(curl -s https://api.papermc.io/v2/projects/vanilla | jq -r '.versions[-1]')\nfi\n\ncurl -o server.jar https://api.papermc.io/v2/projects/vanilla/versions/${VERSION}/builds/latest/downloads/vanilla-${VERSION}.jar\n",
        "entry": "bash",
        "container": "ghcr.io/pterodactyl/installers:alpine",
        "extends": null
      },
      "created_at": "2024-01-01T00:00:00+00:00",
      "updated_at": "2024-02-15T00:00:00+00:00"
    }
  }
  ```
</ResponseExample>

## Get Egg Variables

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://panel.example.com/api/application/nests/{nest_id}/eggs/{egg_id}?include=variables" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```
</CodeGroup>

Retrieves the environment variables defined for an egg.

### Response

When including `variables`, the response includes a `relationships` object with variable details:

<ResponseExample>
  ```json theme={null}
  {
    "object": "egg",
    "attributes": {
      "id": 1,
      "name": "Vanilla Minecraft",
      "...": "..."
    },
    "relationships": {
      "variables": {
        "object": "list",
        "data": [
          {
            "object": "egg_variable",
            "attributes": {
              "id": 1,
              "egg_id": 1,
              "name": "Server Jar File",
              "description": "The name of the server jar file to run.",
              "env_variable": "SERVER_JARFILE",
              "default_value": "server.jar",
              "user_viewable": true,
              "user_editable": true,
              "rules": "required|string|max:20",
              "created_at": "2024-01-01T00:00:00+00:00",
              "updated_at": "2024-01-01T00:00:00+00:00"
            }
          },
          {
            "object": "egg_variable",
            "attributes": {
              "id": 2,
              "egg_id": 1,
              "name": "Server Version",
              "description": "The version of Minecraft to download. Use 'latest' for the latest version.",
              "env_variable": "VANILLA_VERSION",
              "default_value": "latest",
              "user_viewable": true,
              "user_editable": true,
              "rules": "required|string|max:20",
              "created_at": "2024-01-01T00:00:00+00:00",
              "updated_at": "2024-01-01T00:00:00+00:00"
            }
          }
        ]
      }
    }
  }
  ```
</ResponseExample>

### Variable Object

<ResponseField name="id" type="integer">
  Internal variable ID
</ResponseField>

<ResponseField name="egg_id" type="integer">
  ID of the parent egg
</ResponseField>

<ResponseField name="name" type="string">
  Display name of the variable
</ResponseField>

<ResponseField name="description" type="string">
  Description of what the variable does
</ResponseField>

<ResponseField name="env_variable" type="string">
  Environment variable name used in the startup command
</ResponseField>

<ResponseField name="default_value" type="string">
  Default value for the variable
</ResponseField>

<ResponseField name="user_viewable" type="boolean">
  Whether users can view this variable
</ResponseField>

<ResponseField name="user_editable" type="boolean">
  Whether users can edit this variable
</ResponseField>

<ResponseField name="rules" type="string">
  Validation rules (Laravel validation syntax)
</ResponseField>

## Get Egg Configuration

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://panel.example.com/api/application/nests/{nest_id}/eggs/{egg_id}?include=config" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```
</CodeGroup>

Retrrieves detailed configuration information if the egg extends another egg.

## Get Egg Script

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://panel.example.com/api/application/nests/{nest_id}/eggs/{egg_id}?include=script" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```
</CodeGroup>

Retrieves detailed script information if the egg extends another egg for its installation script.

## Usage Examples

### Get All Information for an Egg

```bash theme={null}
curl "https://panel.example.com/api/application/nests/1/eggs/1?include=variables,config,script,nest" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Find Eggs for Server Creation

```bash theme={null}
# Get all eggs in the Minecraft nest with their variables
curl "https://panel.example.com/api/application/nests/1/eggs?include=variables" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Check Available Docker Images

```bash theme={null}
# Get egg details to see available Docker images
curl "https://panel.example.com/api/application/nests/1/eggs/1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  | jq '.attributes.docker_images'
```

This will output:

```json theme={null}
{
  "Java 17": "ghcr.io/pterodactyl/yolks:java_17",
  "Java 11": "ghcr.io/pterodactyl/yolks:java_11",
  "Java 8": "ghcr.io/pterodactyl/yolks:java_8"
}
```
