{"id":21625854,"url":"https://github.com/hostari/pterodactyl_panel_client","last_synced_at":"2025-10-11T13:16:21.366Z","repository":{"id":79682127,"uuid":"601314436","full_name":"hostari/pterodactyl_panel_client","owner":"hostari","description":"Crystal wrapper over Pterodactyl Panel APOI","archived":false,"fork":false,"pushed_at":"2023-09-11T00:21:41.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T13:16:19.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hostari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-13T20:08:21.000Z","updated_at":"2024-10-11T04:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"8839127d-af8a-4f20-a338-8e8572d0c435","html_url":"https://github.com/hostari/pterodactyl_panel_client","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/hostari/pterodactyl_panel_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hostari%2Fpterodactyl_panel_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hostari%2Fpterodactyl_panel_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hostari%2Fpterodactyl_panel_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hostari%2Fpterodactyl_panel_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hostari","download_url":"https://codeload.github.com/hostari/pterodactyl_panel_client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hostari%2Fpterodactyl_panel_client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007314,"owners_count":26084280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T01:10:59.851Z","updated_at":"2025-10-11T13:16:21.326Z","avatar_url":"https://github.com/hostari.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pterodactyl_panel_client\n\nPterodactyl v1 API Client\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     pterodactyl_panel_client:\n       github: hostari/pterodactyl_panel_client\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"pterodactyl_panel_client\"\n```\n\nBuild a new Pterodactyl Panel Client\n```crystal\nclient_sdk = Pterodactyl::Client::Sdk.new(\"p2.hostari.com\", client_token: \"ptlc_...\")\napplication_sdk = Pterodactyl::Application::Sdk.new(\"p2.hostari.com\", application_token: \"ptla_...\")\n```\n\n## Resource Methods\n\nAPI Reference is available on [Dashflo](https://dashflo.net/docs/api/pterodactyl/v1/#req_802e27a56fe142c99db4106d8e8e8892)\n\n### Client Resource Methods\n\nThese methods are scoped to the user accessing them (i.e. if you query for servers, you will only see your servers and not other's servers). You must authenticate using a token starting with `ptlc_` and this is generated when you create a user using the application resource method.\n\n- list servers\n- account =\u003e get account details\n- account =\u003e update email\n- network =\u003e list allocations\n- network =\u003e assign allocation\n- network =\u003e set allocation note\n- network =\u003e set primary allocation\n- network =\u003e unassign allocation\n- backups =\u003e list backups\n- backups =\u003e create backup\n- backups =\u003e backup detaials\n- backups =\u003e download backup\n- backups =\u003e delete backup\n- settings =\u003e rename server\n- settings =\u003e reinstall server\n- startup\n  - list variables\n  - update variable\n- get server details\n- get console details\n- get resource usage\n- send command\n- change power state\n\n### Application Resource Methods\n\nTo use these methods, you must authenticate using a token starting with `ptla_` which can be generated if you are an Admin on your Pterodactyl panel.\n\nCreate user\n```crystal\nclient.create_user(email: \"apiuser@example.com\", username: \"apiuser\", first_name: \"api\", last_name: \"user\")\n```\n\n```json\n{\"object\":\"user\",\"attributes\":{\"id\":18,\"external_id\":null,\"uuid\":\"f2d27757-38b5-4fa2-811a-b41397c0a470\",\"username\":\"xaviapitest8\",\"email\":\"xavi+apitest8@hostari.com\",\"language\":\"en\",\"root_admin\":false,\"2fa\":false,\"avatar_url\":\"https:\\/\\/www.gravatar.com\\/avatar\\/30532f3d3853d1c7949849dabe641fc2.jpg\",\"admin_role_id\":null,\"role_name\":null,\"created_at\":\"2023-02-13T18:11:36+00:00\",\"updated_at\":\"2023-02-13T18:11:36+00:00\"},\"meta\":{\"token\":\"ptlc_U1XFrTgLb8PLqoGNzyCoFFwRtbgiA3IyYzdegLfbXTe\"}}\n```\n\nList locations\n```crystal\nclient.list_locations\n```\n\nGet Location details\n```crystal\nclient.get_location(1)\n```\n\nList servers\n```crystal\nclient.list_servers\n```\n\nGet server details\n```crystal\nclient.get_server(5)\n```\n\nUpdate server details\n```crystal\nclient.update_server_details(5, name: \"name of the server\", user: 1, external_id: \"external id of the server\", description: \"description of the server\")\n```\n\nUpdate build\n```crystal\nclient.update_server_build(5, allocation: 1, memory: 512, swap: 0, disk: 200, io: 500, cpu: 0, threads: nil, feature_limits: {\"databases\" =\u003e 5, \"allocations\" =\u003e 5, \"backups\" =\u003e 2})\n```\n\nUpdate startup\n```crystal\nclient.update_server_startup(5, startup: \"java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}\", environment: {\n    \"SERVER_JARFILE\": \"server.jar\",\n    \"VANILLA_VERSION\": \"latest\"\n  }, egg: 5, image: \"quay.io/pterodactyl/core:java\", skip_scripts: false)\n```\n\nCreate server\n```crystal\ncreate_server_request = CreateServerRequest.new(\n  name: \"Building\",\n  user: 1,\n  egg: 1,\n  docker_image: \"quay.io/pterodactyl/core:java\",\n  startup: \"java -Xms128M -Xmx128M -jar server.jar\",\n  environment: {\n    \"BUNGEE_VERSION\" =\u003e \"latest\",\n    \"SERVER_JARFILE\" =\u003e \"server.jar\"\n  },\n  limits: {\n    \"memory\": 128,\n    \"swap\": 0,\n    \"disk\": 512,\n    \"io\": 500,\n    \"cpu\": 100\n  },\n  feature_limits: {\n    \"databases\": 5,\n    \"backups\": 1\n  },\n  allocation: {\n    \"default\": 17\n  }\n)\nclient.create_server(create_server_request)\n```\n\nSuspend server\n```crystal\nclient.suspend_server(5)\n```\n\nReinstall server\n```crystal\nclient.reinstall_server(5)\n```\n\nDelete server\n```crystal\nclient.delete_server(5) # defaults to force: false\nclient.delete_server(5, force: true)\n```\n\nList nests\n```crystal\nclient.list_nests\n```\n\nGet nest details\n```crystal\nclient.get_nest(1)\n```\n\nList eggs - *Retrieves a list of eggs given a nest id*\n```crystal\nclient.get_eggs(1)\n```\n\nGet egg - *Get egg details given an egg id and nest id*\n```crystal\nclient.get_egg(1, nest_id: 1)\n```\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/hostari/pterodactyl_panel_client/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Xavi Ablaza](https://github.com/xaviablaza) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhostari%2Fpterodactyl_panel_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhostari%2Fpterodactyl_panel_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhostari%2Fpterodactyl_panel_client/lists"}