├── .env.example ├── .github └── workflows │ └── build-release.yaml ├── CODEOWNERS ├── LICENSE ├── README.md ├── build.js ├── glama.json ├── package.json ├── server.js ├── server.ts ├── tsconfig.json └── types.d.ts /.env.example: -------------------------------------------------------------------------------- 1 | # API Configuration 2 | TRANSPORT=stdio # Fixed to stdio 3 | 4 | # Debug 5 | DEBUG=false 6 | 7 | # --- Authorization Configuration --- 8 | # Example for HTTP Bearer Token "apiToken" 9 | APITOKEN=YOUR_TOKEN_VALUE 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/build-release.yaml: -------------------------------------------------------------------------------- 1 | name: build-release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Repo checkout 13 | uses: actions/checkout@v4 14 | 15 | - name: Bump version and push tag 16 | id: bump 17 | uses: mathieudutour/github-tag-action@v6.2 18 | with: 19 | github_token: ${{ secrets.GITHUB_TOKEN }} 20 | release_branches: main 21 | 22 | - name: Release tag 23 | uses: ncipollo/release-action@v1 24 | with: 25 | tag: ${{ steps.bump.outputs.new_tag }} 26 | generateReleaseNotes: true 27 | 28 | publish-npmjs: 29 | runs-on: ubuntu-latest 30 | needs: [release] 31 | permissions: 32 | contents: read 33 | id-token: write 34 | steps: 35 | - uses: actions/checkout@v4 36 | 37 | - uses: actions/setup-node@v4 38 | with: 39 | node-version: '20.x' 40 | registry-url: 'https://registry.npmjs.org' 41 | 42 | - name: Install dependencies 43 | run: npm install 44 | 45 | - name: Publish package 46 | run: npm publish --provenance --access public 47 | env: 48 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 49 | 50 | release-github: 51 | runs-on: ubuntu-latest 52 | needs: [release] 53 | permissions: 54 | contents: read 55 | id-token: write 56 | packages: write 57 | steps: 58 | - uses: actions/checkout@v4 59 | 60 | - uses: actions/setup-node@v4 61 | with: 62 | node-version: '20.x' 63 | registry-url: 'https://npm.pkg.github.com' 64 | scope: '@hostinger' 65 | 66 | - name: Install dependencies 67 | run: npm install 68 | 69 | - name: Publish package 70 | run: | 71 | sed -i 's+"name": ".*+"name": "@${{ github.repository }}",+gI' ./package.json 72 | npm publish --provenance --access public 73 | env: 74 | NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 75 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @hostinger/vps-team-dev 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Hostinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hostinger-api-mcp 2 | 3 | Model Context Protocol (MCP) server for Hostinger API. 4 | 5 | ## Prerequisites 6 | - Node.js version 20 or higher 7 | 8 | If you don't have Node.js installed, you can download it from the [official website](https://nodejs.org/en/download/). 9 | Alternatively, you can use a package manager like [Homebrew](https://brew.sh/) (for macOS) or [Chocolatey](https://chocolatey.org/) (for Windows) to install Node.js. 10 | 11 | We recommend using [NVM (Node Version Manager)](https://github.com/nvm-sh/nvm) to install and manage installed Node.js versions. 12 | After installing NVM, you can install Node.js with the following command: 13 | ```bash 14 | nvm install v20 15 | nvm use v20 16 | ``` 17 | 18 | ## Installation 19 | 20 | To install the MCP server, run one of the following command, depending on your package manager: 21 | 22 | ```bash 23 | # Install globally from npm 24 | npm install -g hostinger-api-mcp 25 | 26 | # Or with yarn 27 | yarn global add hostinger-api-mcp 28 | 29 | # Or with pnpm 30 | pnpm add -g hostinger-api-mcp 31 | ``` 32 | 33 | ## Update 34 | 35 | To update the MCP server to the latest version, use one of the following commands, depending on your package manager: 36 | 37 | ```bash 38 | # Update globally from npm 39 | npm update -g hostinger-api-mcp 40 | 41 | # Or with yarn 42 | yarn global upgrade hostinger-api-mcp 43 | 44 | # Or with pnpm 45 | pnpm update -g hostinger-api-mcp 46 | ``` 47 | 48 | ## Configuration 49 | 50 | The following environment variables can be configured when running the server: 51 | - `DEBUG`: Enable debug logging (true/false) (default: false) 52 | 53 | 54 | - `APITOKEN`: Your API token, which will be sent in the `Authorization` header. 55 | 56 | 57 | 58 | ## Usage 59 | 60 | ### JSON configuration for Claude, Cursor, etc. 61 | 62 | ```json 63 | { 64 | "mcpServers": { 65 | "hostinger-api": { 66 | "command": "hostinger-api-mcp", 67 | "env": { 68 | "DEBUG": "false", 69 | "APITOKEN": "YOUR API TOKEN" 70 | } 71 | } 72 | } 73 | } 74 | ``` 75 | 76 | ### Using SSE Transport 77 | 78 | To use the MCP server with SSE transport, you must run the server with the `--sse` option. 79 | This will enable the server to communicate with clients using Server-Sent Events on localhost port 8100. 80 | Additionally, you can specify the `--host` and `--port` options to set the host and port for the server to listen on. 81 | 82 | Example of running the server with SSE transport: 83 | 84 | ```bash 85 | hostinger-api-mcp --sse --host 127.0.0.1 --port 8100 86 | ``` 87 | 88 | ### Using as an MCP Tool Provider 89 | 90 | This server implements the Model Context Protocol (MCP) and can be used with any MCP-compatible consumer, like Claude.js client or other MCP consumers. 91 | 92 | Example of connecting to this server from a Claude.js client: 93 | 94 | ```javascript 95 | import { MCP } from "claude-js"; 96 | import { createStdio } from "claude-js/mcp"; 97 | 98 | // Create stdin/stdout transport 99 | const transport = createStdio({ command: "hostinger-api-mcp" }); 100 | 101 | // Connect to the MCP server 102 | const mcp = new MCP({ transport }); 103 | await mcp.connect(); 104 | 105 | // List available tools 106 | const { tools } = await mcp.listTools(); 107 | console.log("Available tools:", tools); 108 | 109 | // Call a tool 110 | const result = await mcp.callTool({ 111 | id: "TOOL-ID", 112 | arguments: { param1: "value1" } 113 | }); 114 | console.log("Tool result:", result); 115 | ``` 116 | 117 | ## Available Tools 118 | 119 | This MCP server provides the following tools: 120 | 121 | ### billing_getCatalogItemListV1 122 | 123 | This endpoint retrieves a list of catalog items available for order. 124 | 125 | Prices in catalog items is displayed as cents (without floating point), e.g: float `17.99` is displayed as integer `1799`. 126 | 127 | - **Method**: `GET` 128 | - **Path**: `/api/billing/v1/catalog` 129 | 130 | **Parameters**: 131 | 132 | - `category`: Filter catalog items by category 133 | - `name`: Filter catalog items by name. Use `*` for wildcard search, e.g. `.COM*` to find .com domain 134 | 135 | ### billing_createNewServiceOrderV1 136 | 137 | This endpoint creates a new service order. 138 | 139 | **DEPRECATED** 140 | 141 | To purchase a domain, use [`POST /api/domains/v1/portfolio`](/#tag/domains-portfolio/POST/api/domains/v1/portfolio) instead. 142 | 143 | To purchase a VPS, use [`POST /api/vps/v1/virtual-machines`](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines) instead. 144 | 145 | 146 | To place order, you need to provide payment method ID and list of price items from the catalog endpoint together with quantity. 147 | Coupons also can be provided during order creation. 148 | 149 | Orders created using this endpoint will be set for automatic renewal. 150 | 151 | Some `credit_card` payments might need additional verification, rendering purchase unprocessed. 152 | We recommend use other payment methods than `credit_card` if you encounter this issue. 153 | 154 | - **Method**: `POST` 155 | - **Path**: `/api/billing/v1/orders` 156 | 157 | **Parameters**: 158 | 159 | - `payment_method_id`: Payment method ID (required) 160 | - `items`: items parameter (required) 161 | - `coupons`: Discount coupon codes 162 | 163 | ### billing_setDefaultPaymentMethodV1 164 | 165 | This endpoint sets default payment method for your account. 166 | 167 | - **Method**: `POST` 168 | - **Path**: `/api/billing/v1/payment-methods/{paymentMethodId}` 169 | 170 | **Parameters**: 171 | 172 | - `paymentMethodId`: Payment method ID (required) 173 | 174 | ### billing_deletePaymentMethodV1 175 | 176 | This endpoint deletes a payment method from your account. 177 | 178 | - **Method**: `DELETE` 179 | - **Path**: `/api/billing/v1/payment-methods/{paymentMethodId}` 180 | 181 | **Parameters**: 182 | 183 | - `paymentMethodId`: Payment method ID (required) 184 | 185 | ### billing_getPaymentMethodListV1 186 | 187 | This endpoint retrieves a list of available payment methods that can be used for placing new orders. 188 | 189 | If you want to add new payment method, please use [hPanel](https://hpanel.hostinger.com/billing/payment-methods). 190 | 191 | - **Method**: `GET` 192 | - **Path**: `/api/billing/v1/payment-methods` 193 | 194 | 195 | 196 | ### billing_cancelSubscriptionV1 197 | 198 | This endpoint cancels a subscription and stops any further billing. 199 | 200 | - **Method**: `DELETE` 201 | - **Path**: `/api/billing/v1/subscriptions/{subscriptionId}` 202 | 203 | **Parameters**: 204 | 205 | - `subscriptionId`: Subscription ID (required) 206 | 207 | ### billing_getSubscriptionListV1 208 | 209 | This endpoint retrieves a list of all subscriptions associated with your account. 210 | 211 | - **Method**: `GET` 212 | - **Path**: `/api/billing/v1/subscriptions` 213 | 214 | 215 | 216 | ### DNS_getSnapshotV1 217 | 218 | This endpoint retrieves particular DNS snapshot with the contents of DNS zone records. 219 | 220 | - **Method**: `GET` 221 | - **Path**: `/api/dns/v1/snapshots/{domain}/{snapshotId}` 222 | 223 | **Parameters**: 224 | 225 | - `domain`: Domain name (required) 226 | - `snapshotId`: Snapshot ID (required) 227 | 228 | ### DNS_getSnapshotListV1 229 | 230 | This endpoint retrieves list of DNS snapshots. 231 | 232 | - **Method**: `GET` 233 | - **Path**: `/api/dns/v1/snapshots/{domain}` 234 | 235 | **Parameters**: 236 | 237 | - `domain`: Domain name (required) 238 | 239 | ### DNS_restoreSnapshotV1 240 | 241 | This endpoint restores DNS zone to the selected snapshot. 242 | 243 | - **Method**: `POST` 244 | - **Path**: `/api/dns/v1/snapshots/{domain}/{snapshotId}/restore` 245 | 246 | **Parameters**: 247 | 248 | - `domain`: Domain name (required) 249 | - `snapshotId`: Snapshot ID (required) 250 | 251 | ### DNS_getRecordsV1 252 | 253 | This endpoint retrieves DNS zone records for a specific domain. 254 | 255 | - **Method**: `GET` 256 | - **Path**: `/api/dns/v1/zones/{domain}` 257 | 258 | **Parameters**: 259 | 260 | - `domain`: Domain name (required) 261 | 262 | ### DNS_updateZoneRecordsV1 263 | 264 | This endpoint updates DNS records for the selected domain. 265 | 266 | Using `overwrite = true` will replace existing records with the provided ones. 267 | Otherwise existing records will be updated and new records will be added. 268 | 269 | - **Method**: `PUT` 270 | - **Path**: `/api/dns/v1/zones/{domain}` 271 | 272 | **Parameters**: 273 | 274 | - `domain`: Domain name (required) 275 | - `overwrite`: If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created. 276 | - `zone`: zone parameter (required) 277 | 278 | ### DNS_deleteZoneRecordsV1 279 | 280 | This endpoint deletes DNS records for the selected domain. 281 | To filter which records to delete, add the `name` of the record and `type` to the filter. 282 | Multiple filters can be provided with single request. 283 | 284 | If you have multiple records with the same name and type, and you want to delete only part of them, 285 | refer to the `Update zone records` endpoint. 286 | 287 | - **Method**: `DELETE` 288 | - **Path**: `/api/dns/v1/zones/{domain}` 289 | 290 | **Parameters**: 291 | 292 | - `domain`: Domain name (required) 293 | 294 | ### DNS_resetZoneRecordsV1 295 | 296 | This endpoint resets DNS zone to the default records. 297 | 298 | - **Method**: `POST` 299 | - **Path**: `/api/dns/v1/zones/{domain}/reset` 300 | 301 | **Parameters**: 302 | 303 | - `domain`: Domain name (required) 304 | - `sync`: Determines if operation should be run synchronously 305 | - `reset_email_records`: Determines if email records should be reset 306 | - `whitelisted_record_types`: Specifies which record types to not reset 307 | 308 | ### DNS_validateZoneRecordsV1 309 | 310 | This endpoint used to validate DNS records prior update for the selected domain. 311 | 312 | If the validation is successful, the response will contain `200 Success` code. 313 | If there is validation error, the response will fail with `422 Validation error` code. 314 | 315 | - **Method**: `POST` 316 | - **Path**: `/api/dns/v1/zones/{domain}/validate` 317 | 318 | **Parameters**: 319 | 320 | - `domain`: Domain name (required) 321 | - `overwrite`: If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created. 322 | - `zone`: zone parameter (required) 323 | 324 | ### domains_checkDomainAvailabilityV1 325 | 326 | This endpoint checks the availability of a domain name. Multiple TLDs can be checked at once. 327 | If you want to get alternative domains with response, provide only one TLD in the request and set `with_alternatives` to `true`. 328 | TLDs should be provided without the leading dot (e.g. `com`, `net`, `org`). 329 | 330 | Endpoint has rate limit of 10 requests per minute. 331 | 332 | - **Method**: `POST` 333 | - **Path**: `/api/domains/v1/availability` 334 | 335 | **Parameters**: 336 | 337 | - `domain`: Domain name (without TLD) (required) 338 | - `tlds`: TLDs list (required) 339 | - `with_alternatives`: Should response include alternatives 340 | 341 | ### domains_getForwardingDataV1 342 | 343 | This endpoint retrieves domain forwarding data. 344 | 345 | - **Method**: `GET` 346 | - **Path**: `/api/domains/v1/forwarding/{domain}` 347 | 348 | **Parameters**: 349 | 350 | - `domain`: Domain name (required) 351 | 352 | ### domains_deleteForwardingDataV1 353 | 354 | This endpoint deletes domain forwarding data. 355 | 356 | - **Method**: `DELETE` 357 | - **Path**: `/api/domains/v1/forwarding/{domain}` 358 | 359 | **Parameters**: 360 | 361 | - `domain`: Domain name (required) 362 | 363 | ### domains_createForwardingDataV1 364 | 365 | This endpoint creates domain forwarding data. 366 | 367 | - **Method**: `POST` 368 | - **Path**: `/api/domains/v1/forwarding` 369 | 370 | **Parameters**: 371 | 372 | - `domain`: Domain name (required) 373 | - `redirect_type`: Redirect type (required) 374 | - `redirect_url`: URL to forward domain to (required) 375 | 376 | ### domains_enableDomainLockV1 377 | 378 | This endpoint enables domain lock for the domain. When domain lock is enabled, 379 | the domain cannot be transferred to another registrar without first disabling the lock. 380 | 381 | - **Method**: `PUT` 382 | - **Path**: `/api/domains/v1/portfolio/{domain}/domain-lock` 383 | 384 | **Parameters**: 385 | 386 | - `domain`: Domain name (required) 387 | 388 | ### domains_disableDomainLockV1 389 | 390 | This endpoint disables domain lock for the domain. Domain lock needs to be disabled 391 | before transferring the domain to another registrar. 392 | 393 | - **Method**: `DELETE` 394 | - **Path**: `/api/domains/v1/portfolio/{domain}/domain-lock` 395 | 396 | **Parameters**: 397 | 398 | - `domain`: Domain name (required) 399 | 400 | ### domains_getDomainV1 401 | 402 | This endpoint retrieves details for specified domain. 403 | 404 | - **Method**: `GET` 405 | - **Path**: `/api/domains/v1/portfolio/{domain}` 406 | 407 | **Parameters**: 408 | 409 | - `domain`: Domain name (required) 410 | 411 | ### domains_getDomainListV1 412 | 413 | This endpoint retrieves a list of all domains associated with your account. 414 | 415 | - **Method**: `GET` 416 | - **Path**: `/api/domains/v1/portfolio` 417 | 418 | 419 | 420 | ### domains_purchaseNewDomainV1 421 | 422 | This endpoint allows you to buy (purchase) and register a new domain name. 423 | 424 | If registration fails, login to [hPanel](https://hpanel.hostinger.com/) and check the domain registration status. 425 | 426 | If no payment method is provided, your default payment method will be used automatically. 427 | 428 | If no WHOIS information is provided, the default contact information for that TLD (Top-Level Domain) will be used. 429 | Before making a request, ensure that WHOIS information for the desired TLD exists in your account. 430 | 431 | Some TLDs require `additional_details` to be provided and these will be validated before completing the purchase. The required additional details vary by TLD. 432 | 433 | - **Method**: `POST` 434 | - **Path**: `/api/domains/v1/portfolio` 435 | 436 | **Parameters**: 437 | 438 | - `domain`: Domain name (required) 439 | - `item_id`: Catalog price item ID (required) 440 | - `payment_method_id`: Payment method ID, default will be used if not provided 441 | - `domain_contacts`: Domain contact information 442 | - `additional_details`: Additional registration data, possible values depends on TLD 443 | - `coupons`: Discount coupon codes 444 | 445 | ### domains_enablePrivacyProtectionV1 446 | 447 | This endpoint enables privacy protection for the domain. 448 | When privacy protection is enabled, the domain owner's personal information is hidden from the public WHOIS database. 449 | 450 | - **Method**: `PUT` 451 | - **Path**: `/api/domains/v1/portfolio/{domain}/privacy-protection` 452 | 453 | **Parameters**: 454 | 455 | - `domain`: Domain name (required) 456 | 457 | ### domains_disablePrivacyProtectionV1 458 | 459 | This endpoint disables privacy protection for the domain. 460 | When privacy protection is disabled, the domain owner's personal information is visible in the public WHOIS database. 461 | 462 | - **Method**: `DELETE` 463 | - **Path**: `/api/domains/v1/portfolio/{domain}/privacy-protection` 464 | 465 | **Parameters**: 466 | 467 | - `domain`: Domain name (required) 468 | 469 | ### domains_updateNameserversV1 470 | 471 | This endpoint sets the nameservers for a specified domain. 472 | 473 | Be aware, that improper nameserver configuration can lead to the domain being unresolvable or unavailable. 474 | 475 | - **Method**: `PUT` 476 | - **Path**: `/api/domains/v1/portfolio/{domain}/nameservers` 477 | 478 | **Parameters**: 479 | 480 | - `domain`: Domain name (required) 481 | - `ns1`: First name server (required) 482 | - `ns2`: Second name server (required) 483 | - `ns3`: Third name server 484 | - `ns4`: Fourth name server 485 | 486 | ### domains_getWHOISProfileV1 487 | 488 | This endpoint retrieves a WHOIS contact profile. 489 | 490 | - **Method**: `GET` 491 | - **Path**: `/api/domains/v1/whois/{whoisId}` 492 | 493 | **Parameters**: 494 | 495 | - `whoisId`: WHOIS ID (required) 496 | 497 | ### domains_deleteWHOISProfileV1 498 | 499 | This endpoint deletes WHOIS contact profile. 500 | 501 | - **Method**: `DELETE` 502 | - **Path**: `/api/domains/v1/whois/{whoisId}` 503 | 504 | **Parameters**: 505 | 506 | - `whoisId`: WHOIS ID (required) 507 | 508 | ### domains_getWHOISProfileListV1 509 | 510 | This endpoint retrieves a list of WHOIS contact profiles. 511 | 512 | - **Method**: `GET` 513 | - **Path**: `/api/domains/v1/whois` 514 | 515 | **Parameters**: 516 | 517 | - `tld`: Filter by TLD (without leading dot) 518 | 519 | ### domains_createWHOISProfileV1 520 | 521 | This endpoint creates WHOIS contact profile. 522 | 523 | - **Method**: `POST` 524 | - **Path**: `/api/domains/v1/whois` 525 | 526 | **Parameters**: 527 | 528 | - `tld`: TLD of the domain (without leading dot) (required) 529 | - `country`: ISO 3166 2-letter country code (required) 530 | - `entity_type`: Legal entity type (required) 531 | - `tld_details`: TLD details 532 | - `whois_details`: WHOIS details (required) 533 | 534 | ### domains_getWHOISProfileUsageV1 535 | 536 | This endpoint retrieves a domain list where provided WHOIS contact profile is used. 537 | 538 | - **Method**: `GET` 539 | - **Path**: `/api/domains/v1/whois/{whoisId}/usage` 540 | 541 | **Parameters**: 542 | 543 | - `whoisId`: WHOIS ID (required) 544 | 545 | ### VPS_getDataCentersListV1 546 | 547 | This endpoint retrieves a list of all data centers available. 548 | 549 | - **Method**: `GET` 550 | - **Path**: `/api/vps/v1/data-centers` 551 | 552 | 553 | 554 | ### VPS_activateFirewallV1 555 | 556 | This endpoint activates a firewall for a specified virtual machine. 557 | 558 | Only one firewall can be active for a virtual machine at a time. 559 | 560 | - **Method**: `POST` 561 | - **Path**: `/api/vps/v1/firewall/{firewallId}/activate/{virtualMachineId}` 562 | 563 | **Parameters**: 564 | 565 | - `firewallId`: Firewall ID (required) 566 | - `virtualMachineId`: Virtual Machine ID (required) 567 | 568 | ### VPS_deactivateFirewallV1 569 | 570 | This endpoint deactivates a firewall for a specified virtual machine. 571 | 572 | - **Method**: `POST` 573 | - **Path**: `/api/vps/v1/firewall/{firewallId}/deactivate/{virtualMachineId}` 574 | 575 | **Parameters**: 576 | 577 | - `firewallId`: Firewall ID (required) 578 | - `virtualMachineId`: Virtual Machine ID (required) 579 | 580 | ### VPS_getFirewallV1 581 | 582 | This endpoint retrieves firewall by its ID and rules associated with it. 583 | 584 | - **Method**: `GET` 585 | - **Path**: `/api/vps/v1/firewall/{firewallId}` 586 | 587 | **Parameters**: 588 | 589 | - `firewallId`: Firewall ID (required) 590 | 591 | ### VPS_deleteFirewallV1 592 | 593 | This endpoint deletes a specified firewall. 594 | 595 | Any virtual machine that has this firewall activated will automatically have it deactivated. 596 | 597 | - **Method**: `DELETE` 598 | - **Path**: `/api/vps/v1/firewall/{firewallId}` 599 | 600 | **Parameters**: 601 | 602 | - `firewallId`: Firewall ID (required) 603 | 604 | ### VPS_getFirewallListV1 605 | 606 | This endpoint retrieves a list of all firewalls available. 607 | 608 | - **Method**: `GET` 609 | - **Path**: `/api/vps/v1/firewall` 610 | 611 | **Parameters**: 612 | 613 | - `page`: Page number 614 | 615 | ### VPS_createNewFirewallV1 616 | 617 | This endpoint creates a new firewall. 618 | 619 | - **Method**: `POST` 620 | - **Path**: `/api/vps/v1/firewall` 621 | 622 | **Parameters**: 623 | 624 | - `name`: name parameter (required) 625 | 626 | ### VPS_updateFirewallRuleV1 627 | 628 | This endpoint updates a specific firewall rule from a specified firewall. 629 | 630 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 631 | 632 | - **Method**: `PUT` 633 | - **Path**: `/api/vps/v1/firewall/{firewallId}/rules/{ruleId}` 634 | 635 | **Parameters**: 636 | 637 | - `firewallId`: Firewall ID (required) 638 | - `ruleId`: Firewall Rule ID (required) 639 | - `protocol`: protocol parameter (required) 640 | - `port`: Port or port range, ex: 1024:2048 (required) 641 | - `source`: source parameter (required) 642 | - `source_detail`: IP range, CIDR, single IP or `any` (required) 643 | 644 | ### VPS_deleteFirewallRuleV1 645 | 646 | This endpoint deletes a specific firewall rule from a specified firewall. 647 | 648 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 649 | 650 | - **Method**: `DELETE` 651 | - **Path**: `/api/vps/v1/firewall/{firewallId}/rules/{ruleId}` 652 | 653 | **Parameters**: 654 | 655 | - `firewallId`: Firewall ID (required) 656 | - `ruleId`: Firewall Rule ID (required) 657 | 658 | ### VPS_createFirewallRuleV1 659 | 660 | This endpoint creates new firewall rule from a specified firewall. 661 | By default, the firewall drops all incoming traffic, which means you must add accept rules for all ports you want to use. 662 | 663 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 664 | 665 | - **Method**: `POST` 666 | - **Path**: `/api/vps/v1/firewall/{firewallId}/rules` 667 | 668 | **Parameters**: 669 | 670 | - `firewallId`: Firewall ID (required) 671 | - `protocol`: protocol parameter (required) 672 | - `port`: Port or port range, ex: 1024:2048 (required) 673 | - `source`: source parameter (required) 674 | - `source_detail`: IP range, CIDR, single IP or `any` (required) 675 | 676 | ### VPS_syncFirewallV1 677 | 678 | This endpoint syncs a firewall for a specified virtual machine. 679 | 680 | Firewall can loose sync with virtual machine if the firewall has new rules added, removed or updated. 681 | 682 | - **Method**: `POST` 683 | - **Path**: `/api/vps/v1/firewall/{firewallId}/sync/{virtualMachineId}` 684 | 685 | **Parameters**: 686 | 687 | - `firewallId`: Firewall ID (required) 688 | - `virtualMachineId`: Virtual Machine ID (required) 689 | 690 | ### VPS_getPostInstallScriptV1 691 | 692 | This endpoint retrieves post-install script by its ID. 693 | 694 | - **Method**: `GET` 695 | - **Path**: `/api/vps/v1/post-install-scripts/{postInstallScriptId}` 696 | 697 | **Parameters**: 698 | 699 | - `postInstallScriptId`: Post-install script ID (required) 700 | 701 | ### VPS_updatePostInstallScriptV1 702 | 703 | This endpoint updates a specific post-install script. 704 | 705 | - **Method**: `PUT` 706 | - **Path**: `/api/vps/v1/post-install-scripts/{postInstallScriptId}` 707 | 708 | **Parameters**: 709 | 710 | - `postInstallScriptId`: Post-install script ID (required) 711 | - `name`: Name of the script (required) 712 | - `content`: Content of the script (required) 713 | 714 | ### VPS_deleteAPostInstallScriptV1 715 | 716 | This endpoint deletes a post-install script from your account. 717 | 718 | - **Method**: `DELETE` 719 | - **Path**: `/api/vps/v1/post-install-scripts/{postInstallScriptId}` 720 | 721 | **Parameters**: 722 | 723 | - `postInstallScriptId`: Post-install script ID (required) 724 | 725 | ### VPS_getPostInstallScriptListV1 726 | 727 | This endpoint retrieves a list of post-install scripts associated with your account. 728 | 729 | - **Method**: `GET` 730 | - **Path**: `/api/vps/v1/post-install-scripts` 731 | 732 | **Parameters**: 733 | 734 | - `page`: Page number 735 | 736 | ### VPS_createPostInstallScriptV1 737 | 738 | This endpoint allows you to add a new post-install script to your account, 739 | which can then be used run after the installation of a virtual machine instance. 740 | 741 | The script contents will be saved to the file `/post_install` with executable attribute set and will be executed once virtual machine is installed. 742 | The output of the script will be redirected to `/post_install.log`. Maximum script size is 48KB. 743 | 744 | - **Method**: `POST` 745 | - **Path**: `/api/vps/v1/post-install-scripts` 746 | 747 | **Parameters**: 748 | 749 | - `name`: Name of the script (required) 750 | - `content`: Content of the script (required) 751 | 752 | ### VPS_attachPublicKeyV1 753 | 754 | This endpoint attaches an existing public keys from your account to a specified virtual machine. 755 | 756 | Multiple keys can be attached to a single virtual machine. 757 | 758 | - **Method**: `POST` 759 | - **Path**: `/api/vps/v1/public-keys/attach/{virtualMachineId}` 760 | 761 | **Parameters**: 762 | 763 | - `virtualMachineId`: Virtual Machine ID (required) 764 | - `ids`: Public Key IDs to attach (required) 765 | 766 | ### VPS_deleteAPublicKeyV1 767 | 768 | This endpoint deletes a public key from your account. 769 | 770 | **Deleting public key from account does not remove it from virtual machine** 771 | 772 | - **Method**: `DELETE` 773 | - **Path**: `/api/vps/v1/public-keys/{publicKeyId}` 774 | 775 | **Parameters**: 776 | 777 | - `publicKeyId`: Public Key ID (required) 778 | 779 | ### VPS_getPublicKeyListV1 780 | 781 | This endpoint retrieves a list of public keys associated with your account. 782 | 783 | - **Method**: `GET` 784 | - **Path**: `/api/vps/v1/public-keys` 785 | 786 | **Parameters**: 787 | 788 | - `page`: Page number 789 | 790 | ### VPS_createNewPublicKeyV1 791 | 792 | This endpoint allows you to add a new public key to your account, 793 | which can then be attached to virtual machine instances for secure access. 794 | 795 | - **Method**: `POST` 796 | - **Path**: `/api/vps/v1/public-keys` 797 | 798 | **Parameters**: 799 | 800 | - `name`: name parameter (required) 801 | - `key`: key parameter (required) 802 | 803 | ### VPS_getTemplateV1 804 | 805 | This endpoint retrieves details of a specific OS template for virtual machines. 806 | 807 | - **Method**: `GET` 808 | - **Path**: `/api/vps/v1/templates/{templateId}` 809 | 810 | **Parameters**: 811 | 812 | - `templateId`: Template ID (required) 813 | 814 | ### VPS_getTemplateListV1 815 | 816 | This endpoint retrieves a list of available OS templates for virtual machines. 817 | 818 | - **Method**: `GET` 819 | - **Path**: `/api/vps/v1/templates` 820 | 821 | 822 | 823 | ### VPS_getActionV1 824 | 825 | This endpoint retrieves details of a specific action performed on a specified virtual machine. 826 | 827 | This endpoint allows you to view detailed information about a particular action, including the action name, timestamp, and status. 828 | 829 | - **Method**: `GET` 830 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/actions/{actionId}` 831 | 832 | **Parameters**: 833 | 834 | - `virtualMachineId`: Virtual Machine ID (required) 835 | - `actionId`: Action ID (required) 836 | 837 | ### VPS_getActionListV1 838 | 839 | This endpoint retrieves a list of actions performed on a specified virtual machine. 840 | 841 | Actions are operations or events that have been executed on the virtual machine, such as starting, stopping, or modifying 842 | the machine. This endpoint allows you to view the history of these actions, providing details about each action, 843 | such as the action name, timestamp, and status. 844 | 845 | - **Method**: `GET` 846 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/actions` 847 | 848 | **Parameters**: 849 | 850 | - `virtualMachineId`: Virtual Machine ID (required) 851 | - `page`: Page number 852 | 853 | ### VPS_getAttachedPublicKeysV1 854 | 855 | This endpoint retrieves a list of public keys attached to a specified virtual machine. 856 | 857 | - **Method**: `GET` 858 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/public-keys` 859 | 860 | **Parameters**: 861 | 862 | - `virtualMachineId`: Virtual Machine ID (required) 863 | - `page`: Page number 864 | 865 | ### VPS_deleteBackupV1 866 | 867 | This endpoint deletes a specified backup for a virtual machine. 868 | 869 | - **Method**: `DELETE` 870 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/backups/{backupId}` 871 | 872 | **Parameters**: 873 | 874 | - `virtualMachineId`: Virtual Machine ID (required) 875 | - `backupId`: Backup ID (required) 876 | 877 | ### VPS_getBackupListV1 878 | 879 | This endpoint retrieves a list of backups for a specified virtual machine. 880 | 881 | - **Method**: `GET` 882 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/backups` 883 | 884 | **Parameters**: 885 | 886 | - `virtualMachineId`: Virtual Machine ID (required) 887 | - `page`: Page number 888 | 889 | ### VPS_restoreBackupV1 890 | 891 | This endpoint restores a backup for a specified virtual machine. 892 | 893 | The system will then initiate the restore process, which may take some time depending on the size of the backup. 894 | 895 | **All data on the virtual machine will be overwritten with the data from the backup.** 896 | 897 | - **Method**: `POST` 898 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/backups/{backupId}/restore` 899 | 900 | **Parameters**: 901 | 902 | - `virtualMachineId`: Virtual Machine ID (required) 903 | - `backupId`: Backup ID (required) 904 | 905 | ### VPS_setHostnameV1 906 | 907 | This endpoint sets the hostname for a specified virtual machine. 908 | Changing hostname does not update PTR record automatically. 909 | If you want your virtual machine to be reachable by a hostname, 910 | you need to point your domain A/AAAA records to virtual machine IP as well. 911 | 912 | - **Method**: `PUT` 913 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/hostname` 914 | 915 | **Parameters**: 916 | 917 | - `virtualMachineId`: Virtual Machine ID (required) 918 | - `hostname`: hostname parameter (required) 919 | 920 | ### VPS_resetHostnameV1 921 | 922 | This endpoint resets the hostname and PTR record of a specified virtual machine to the default value. 923 | 924 | - **Method**: `DELETE` 925 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/hostname` 926 | 927 | **Parameters**: 928 | 929 | - `virtualMachineId`: Virtual Machine ID (required) 930 | 931 | ### VPS_getVirtualMachineV1 932 | 933 | This endpoint retrieves detailed information about a specified virtual machine. 934 | 935 | - **Method**: `GET` 936 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}` 937 | 938 | **Parameters**: 939 | 940 | - `virtualMachineId`: Virtual Machine ID (required) 941 | 942 | ### VPS_getVirtualMachineListV1 943 | 944 | This endpoint retrieves a list of all available virtual machines. 945 | 946 | - **Method**: `GET` 947 | - **Path**: `/api/vps/v1/virtual-machines` 948 | 949 | 950 | 951 | ### VPS_purchaseNewVirtualMachineV1 952 | 953 | This endpoint allows you to buy (purchase) and setup a new virtual machine. 954 | 955 | If virtual machine setup fails for any reason, login to [hPanel](https://hpanel.hostinger.com/) and complete the setup manually. 956 | 957 | If no payment method is provided, your default payment method will be used automatically. 958 | 959 | - **Method**: `POST` 960 | - **Path**: `/api/vps/v1/virtual-machines` 961 | 962 | **Parameters**: 963 | 964 | - `item_id`: Catalog price item ID (required) 965 | - `payment_method_id`: Payment method ID, default will be used if not provided 966 | - `setup`: setup parameter (required) 967 | - `coupons`: Discount coupon codes 968 | 969 | ### VPS_getScanMetricsV1 970 | 971 | This endpoint retrieves the scan metrics for the [Monarx](https://www.monarx.com/) malware scanner installed on a specified virtual machine. 972 | The scan metrics provide detailed information about the malware scans performed by Monarx, including the number of scans, 973 | detected threats, and other relevant statistics. This information is useful for monitoring the security status of the 974 | virtual machine and assessing the effectiveness of the malware scanner. 975 | 976 | - **Method**: `GET` 977 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/monarx` 978 | 979 | **Parameters**: 980 | 981 | - `virtualMachineId`: Virtual Machine ID (required) 982 | 983 | ### VPS_installMonarxV1 984 | 985 | This endpoint installs the Monarx malware scanner on a specified virtual machine. 986 | 987 | [Monarx](https://www.monarx.com/) is a security tool designed to detect and prevent malware infections on virtual machines. 988 | By installing Monarx, users can enhance the security of their virtual machines, ensuring that they are protected against malicious software. 989 | 990 | - **Method**: `POST` 991 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/monarx` 992 | 993 | **Parameters**: 994 | 995 | - `virtualMachineId`: Virtual Machine ID (required) 996 | 997 | ### VPS_uninstallMonarxV1 998 | 999 | This endpoint uninstalls the Monarx malware scanner on a specified virtual machine. 1000 | If Monarx is not installed, the request will still be processed without any effect. 1001 | 1002 | - **Method**: `DELETE` 1003 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/monarx` 1004 | 1005 | **Parameters**: 1006 | 1007 | - `virtualMachineId`: Virtual Machine ID (required) 1008 | 1009 | ### VPS_getMetricsV1 1010 | 1011 | This endpoint retrieves the historical metrics for a specified virtual machine. 1012 | It includes the following metrics: 1013 | - CPU usage 1014 | - Memory usage 1015 | - Disk usage 1016 | - Network usage 1017 | - Uptime 1018 | 1019 | - **Method**: `GET` 1020 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/metrics` 1021 | 1022 | **Parameters**: 1023 | 1024 | - `virtualMachineId`: Virtual Machine ID (required) 1025 | - `date_from`: date_from parameter (required) 1026 | - `date_to`: date_to parameter (required) 1027 | 1028 | ### VPS_setNameserversV1 1029 | 1030 | This endpoint sets the nameservers for a specified virtual machine. 1031 | Be aware, that improper nameserver configuration can lead to the virtual machine being unable to resolve domain names. 1032 | 1033 | - **Method**: `PUT` 1034 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/nameservers` 1035 | 1036 | **Parameters**: 1037 | 1038 | - `virtualMachineId`: Virtual Machine ID (required) 1039 | - `ns1`: ns1 parameter (required) 1040 | - `ns2`: ns2 parameter 1041 | 1042 | ### VPS_createPTRRecordV1 1043 | 1044 | This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine. 1045 | 1046 | - **Method**: `POST` 1047 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/ptr` 1048 | 1049 | **Parameters**: 1050 | 1051 | - `virtualMachineId`: Virtual Machine ID (required) 1052 | 1053 | ### VPS_deletePTRRecordV1 1054 | 1055 | This endpoint deletes a PTR (Pointer) record for a specified virtual machine. 1056 | 1057 | Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname. 1058 | 1059 | - **Method**: `DELETE` 1060 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/ptr` 1061 | 1062 | **Parameters**: 1063 | 1064 | - `virtualMachineId`: Virtual Machine ID (required) 1065 | 1066 | ### VPS_setPanelPasswordV1 1067 | 1068 | This endpoint sets the panel password for a specified virtual machine. 1069 | If virtual machine does not use panel OS, the request will still be processed without any effect. 1070 | Requirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). 1071 | 1072 | - **Method**: `PUT` 1073 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/panel-password` 1074 | 1075 | **Parameters**: 1076 | 1077 | - `virtualMachineId`: Virtual Machine ID (required) 1078 | - `password`: Panel password for the virtual machine (required) 1079 | 1080 | ### VPS_startRecoveryModeV1 1081 | 1082 | This endpoint initiates the recovery mode for a specified virtual machine. 1083 | Recovery mode is a special state that allows users to perform system rescue operations, 1084 | such as repairing file systems, recovering data, or troubleshooting issues that prevent the virtual machine 1085 | from booting normally. 1086 | 1087 | Virtual machine will boot recovery disk image and original disk image will be mounted in `/mnt` directory. 1088 | 1089 | - **Method**: `POST` 1090 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/recovery` 1091 | 1092 | **Parameters**: 1093 | 1094 | - `virtualMachineId`: Virtual Machine ID (required) 1095 | - `root_password`: Temporary root password for recovery mode (required) 1096 | 1097 | ### VPS_stopRecoveryModeV1 1098 | 1099 | This endpoint stops the recovery mode for a specified virtual machine. 1100 | If virtual machine is not in recovery mode, this operation will fail. 1101 | 1102 | - **Method**: `DELETE` 1103 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/recovery` 1104 | 1105 | **Parameters**: 1106 | 1107 | - `virtualMachineId`: Virtual Machine ID (required) 1108 | 1109 | ### VPS_recreateVirtualMachineV1 1110 | 1111 | This endpoint will recreate a virtual machine from scratch. 1112 | The recreation process involves reinstalling the operating system and resetting the virtual machine to its initial state. 1113 | Snapshots, if there are any, will be deleted. 1114 | 1115 | ## Password Requirements 1116 | Password will be checked against leaked password databases. 1117 | Requirements for the password are: 1118 | - At least 8 characters long 1119 | - At least one uppercase letter 1120 | - At least one lowercase letter 1121 | - At least one number 1122 | - Is not leaked publicly 1123 | 1124 | **This operation is irreversible and will result in the loss of all data stored on the virtual machine!** 1125 | 1126 | - **Method**: `POST` 1127 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/recreate` 1128 | 1129 | **Parameters**: 1130 | 1131 | - `virtualMachineId`: Virtual Machine ID (required) 1132 | - `template_id`: Template ID (required) 1133 | - `password`: Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response. 1134 | - `post_install_script_id`: Post-install script ID 1135 | 1136 | ### VPS_restartVirtualMachineV1 1137 | 1138 | This endpoint restarts a specified virtual machine. This is equivalent to fully stopping and starting the virtual machine. 1139 | If the virtual machine was stopped, it will be started. 1140 | 1141 | - **Method**: `POST` 1142 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/restart` 1143 | 1144 | **Parameters**: 1145 | 1146 | - `virtualMachineId`: Virtual Machine ID (required) 1147 | 1148 | ### VPS_setRootPasswordV1 1149 | 1150 | This endpoint sets the root password for a specified virtual machine. 1151 | Requirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). 1152 | 1153 | - **Method**: `PUT` 1154 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/root-password` 1155 | 1156 | **Parameters**: 1157 | 1158 | - `virtualMachineId`: Virtual Machine ID (required) 1159 | - `password`: Root password for the virtual machine (required) 1160 | 1161 | ### VPS_setupNewVirtualMachineV1 1162 | 1163 | This endpoint will setup newly purchased virtual machine with `initial` state. 1164 | 1165 | - **Method**: `POST` 1166 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/setup` 1167 | 1168 | **Parameters**: 1169 | 1170 | - `virtualMachineId`: Virtual Machine ID (required) 1171 | - `template_id`: Template ID (required) 1172 | - `data_center_id`: Data center ID (required) 1173 | - `post_install_script_id`: Post-install script ID 1174 | - `password`: Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response. 1175 | - `hostname`: Override default hostname of the virtual machine 1176 | - `install_monarx`: Install Monarx malware scanner (if supported) 1177 | - `enable_backups`: Enable weekly backup schedule 1178 | - `ns1`: Name server 1 1179 | - `ns2`: Name server 2 1180 | - `public_key`: Use SSH key 1181 | 1182 | ### VPS_getSnapshotV1 1183 | 1184 | This endpoint retrieves a snapshot for a specified virtual machine. 1185 | 1186 | - **Method**: `GET` 1187 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot` 1188 | 1189 | **Parameters**: 1190 | 1191 | - `virtualMachineId`: Virtual Machine ID (required) 1192 | 1193 | ### VPS_createSnapshotV1 1194 | 1195 | This endpoint creates a snapshot of a specified virtual machine. 1196 | A snapshot captures the state and data of the virtual machine at a specific point in time, 1197 | allowing users to restore the virtual machine to that state if needed. 1198 | This operation is useful for backup purposes, system recovery, 1199 | and testing changes without affecting the current state of the virtual machine. 1200 | 1201 | **Creating new snapshot will overwrite the existing snapshot!** 1202 | 1203 | - **Method**: `POST` 1204 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot` 1205 | 1206 | **Parameters**: 1207 | 1208 | - `virtualMachineId`: Virtual Machine ID (required) 1209 | 1210 | ### VPS_deleteSnapshotV1 1211 | 1212 | This endpoint deletes a snapshot of a specified virtual machine. 1213 | 1214 | - **Method**: `DELETE` 1215 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot` 1216 | 1217 | **Parameters**: 1218 | 1219 | - `virtualMachineId`: Virtual Machine ID (required) 1220 | 1221 | ### VPS_restoreSnapshotV1 1222 | 1223 | This endpoint restores a specified virtual machine to a previous state using a snapshot. 1224 | Restoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing. 1225 | 1226 | - **Method**: `POST` 1227 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot/restore` 1228 | 1229 | **Parameters**: 1230 | 1231 | - `virtualMachineId`: Virtual Machine ID (required) 1232 | 1233 | ### VPS_startVirtualMachineV1 1234 | 1235 | This endpoint starts a specified virtual machine. 1236 | If the virtual machine is already running, the request will still be processed without any effect. 1237 | 1238 | - **Method**: `POST` 1239 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/start` 1240 | 1241 | **Parameters**: 1242 | 1243 | - `virtualMachineId`: Virtual Machine ID (required) 1244 | 1245 | ### VPS_stopVirtualMachineV1 1246 | 1247 | This endpoint stops a specified virtual machine. 1248 | If the virtual machine is already stopped, the request will still be processed without any effect. 1249 | 1250 | - **Method**: `POST` 1251 | - **Path**: `/api/vps/v1/virtual-machines/{virtualMachineId}/stop` 1252 | 1253 | **Parameters**: 1254 | 1255 | - `virtualMachineId`: Virtual Machine ID (required) 1256 | -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { exec } from 'child_process'; 4 | import fs from 'fs'; 5 | import path from 'path'; 6 | import { fileURLToPath } from 'url'; 7 | 8 | // Get proper paths for ES modules 9 | const __filename = fileURLToPath(import.meta.url); 10 | const __dirname = path.dirname(__filename); 11 | 12 | // Ensure dist directory exists 13 | if (!fs.existsSync('./dist')) { 14 | fs.mkdirSync('./dist'); 15 | } 16 | 17 | // Run TypeScript compiler 18 | console.log('Compiling TypeScript...'); 19 | exec('npx tsc', (error, stdout, stderr) => { 20 | if (error) { 21 | console.error('Error compiling TypeScript:', error); 22 | console.error(stderr); 23 | process.exit(1); 24 | } 25 | 26 | if (stdout) { 27 | console.log(stdout); 28 | } 29 | 30 | console.log('TypeScript compilation successful'); 31 | 32 | // Copy .env.example to dist 33 | try { 34 | if (fs.existsSync('./.env.example')) { 35 | fs.copyFileSync('./.env.example', './dist/.env.example'); 36 | console.log('Copied .env.example to dist directory'); 37 | } 38 | 39 | if (fs.existsSync('./README.md')) { 40 | fs.copyFileSync('./README.md', './dist/README.md'); 41 | console.log('Copied README.md to dist directory'); 42 | } 43 | 44 | // Create package.json in dist 45 | const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); 46 | packageJson.main = 'server.js'; 47 | fs.writeFileSync('./dist/package.json', JSON.stringify(packageJson, null, 2)); 48 | console.log('Created package.json in dist directory'); 49 | 50 | console.log('Build completed successfully'); 51 | } catch (err) { 52 | console.error('Error copying files:', err); 53 | process.exit(1); 54 | } 55 | }); 56 | -------------------------------------------------------------------------------- /glama.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://glama.ai/mcp/schemas/server.json", 3 | "maintainers": [ 4 | "algirdasci", 5 | "fizikiukas" 6 | ] 7 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hostinger-api-mcp", 3 | "version": "0.0.22", 4 | "description": "MCP server for Hostinger API", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/hostinger/api-mcp-server.git" 8 | }, 9 | "license": "MIT", 10 | "keywords": [ 11 | "hostinger", 12 | "mcp", 13 | "server", 14 | "rest", 15 | "api" 16 | ], 17 | "type": "module", 18 | "main": "server.js", 19 | "bin": { 20 | "hostinger-api-mcp": "./server.js" 21 | }, 22 | "scripts": { 23 | "start": "node server.js", 24 | "build": "node build.js", 25 | "start:ts": "npx tsc && node dist/server.js" 26 | }, 27 | "dependencies": { 28 | "@modelcontextprotocol/sdk": "^1.0.0", 29 | "minimist": "^1.2.8", 30 | "express": "^5.1.0", 31 | "axios": "^1.8.0", 32 | "dotenv": "^16.0.0" 33 | }, 34 | "devDependencies": { 35 | "@types/node": "^20.11.0", 36 | "typescript": "^5.3.3" 37 | }, 38 | "engines": { 39 | "node": ">=20.0.0" 40 | } 41 | } -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { Server } from "@modelcontextprotocol/sdk/server/index.js"; 4 | import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; 5 | import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"; 6 | import minimist from 'minimist'; 7 | import express from "express"; 8 | import axios from "axios"; 9 | import { config as dotenvConfig } from "dotenv"; 10 | import { 11 | ListToolsRequestSchema, 12 | CallToolRequestSchema, 13 | } from "@modelcontextprotocol/sdk/types.js"; 14 | 15 | // Load environment variables 16 | dotenvConfig(); 17 | 18 | // Define tool schemas 19 | const TOOLS = [ 20 | { 21 | "name": "billing_getCatalogItemListV1", 22 | "description": "This endpoint retrieves a list of catalog items available for order. \n\nPrices in catalog items is displayed as cents (without floating point), e.g: float `17.99` is displayed as integer `1799`.", 23 | "method": "GET", 24 | "path": "/api/billing/v1/catalog", 25 | "inputSchema": { 26 | "type": "object", 27 | "properties": { 28 | "category": { 29 | "type": "string", 30 | "description": "Filter catalog items by category", 31 | "enum": [ 32 | "DOMAIN", 33 | "VPS" 34 | ] 35 | }, 36 | "name": { 37 | "type": "string", 38 | "description": "Filter catalog items by name. Use `*` for wildcard search, e.g. `.COM*` to find .com domain" 39 | } 40 | }, 41 | "required": [] 42 | }, 43 | "security": [ 44 | { 45 | "apiToken": [] 46 | } 47 | ] 48 | }, 49 | { 50 | "name": "billing_createNewServiceOrderV1", 51 | "description": "This endpoint creates a new service order. \n\n**DEPRECATED**\n\nTo purchase a domain, use [`POST /api/domains/v1/portfolio`](/#tag/domains-portfolio/POST/api/domains/v1/portfolio) instead.\n\nTo purchase a VPS, use [`POST /api/vps/v1/virtual-machines`](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines) instead.\n\n\nTo place order, you need to provide payment method ID and list of price items from the catalog endpoint together with quantity.\nCoupons also can be provided during order creation.\n\nOrders created using this endpoint will be set for automatic renewal.\n\nSome `credit_card` payments might need additional verification, rendering purchase unprocessed.\nWe recommend use other payment methods than `credit_card` if you encounter this issue.", 52 | "method": "POST", 53 | "path": "/api/billing/v1/orders", 54 | "inputSchema": { 55 | "type": "object", 56 | "properties": { 57 | "payment_method_id": { 58 | "type": "integer", 59 | "description": "Payment method ID" 60 | }, 61 | "items": { 62 | "type": "array", 63 | "description": "items parameter", 64 | "items": { 65 | "type": "object", 66 | "description": "items parameter", 67 | "properties": { 68 | "item_id": { 69 | "type": "string", 70 | "description": "Price Item ID" 71 | }, 72 | "quantity": { 73 | "type": "integer", 74 | "description": "quantity parameter" 75 | } 76 | }, 77 | "required": [ 78 | "item_id", 79 | "quantity" 80 | ] 81 | } 82 | }, 83 | "coupons": { 84 | "type": "array", 85 | "description": "Discount coupon codes", 86 | "items": { 87 | "type": "string", 88 | "description": "coupons parameter" 89 | } 90 | } 91 | }, 92 | "required": [ 93 | "payment_method_id", 94 | "items" 95 | ] 96 | }, 97 | "security": [ 98 | { 99 | "apiToken": [] 100 | } 101 | ] 102 | }, 103 | { 104 | "name": "billing_setDefaultPaymentMethodV1", 105 | "description": "This endpoint sets default payment method for your account.", 106 | "method": "POST", 107 | "path": "/api/billing/v1/payment-methods/{paymentMethodId}", 108 | "inputSchema": { 109 | "type": "object", 110 | "properties": { 111 | "paymentMethodId": { 112 | "type": "integer", 113 | "description": "Payment method ID" 114 | } 115 | }, 116 | "required": [ 117 | "paymentMethodId" 118 | ] 119 | }, 120 | "security": [ 121 | { 122 | "apiToken": [] 123 | } 124 | ] 125 | }, 126 | { 127 | "name": "billing_deletePaymentMethodV1", 128 | "description": "This endpoint deletes a payment method from your account.", 129 | "method": "DELETE", 130 | "path": "/api/billing/v1/payment-methods/{paymentMethodId}", 131 | "inputSchema": { 132 | "type": "object", 133 | "properties": { 134 | "paymentMethodId": { 135 | "type": "integer", 136 | "description": "Payment method ID" 137 | } 138 | }, 139 | "required": [ 140 | "paymentMethodId" 141 | ] 142 | }, 143 | "security": [ 144 | { 145 | "apiToken": [] 146 | } 147 | ] 148 | }, 149 | { 150 | "name": "billing_getPaymentMethodListV1", 151 | "description": "This endpoint retrieves a list of available payment methods that can be used for placing new orders.\n\nIf you want to add new payment method, please use [hPanel](https://hpanel.hostinger.com/billing/payment-methods).", 152 | "method": "GET", 153 | "path": "/api/billing/v1/payment-methods", 154 | "inputSchema": { 155 | "type": "object", 156 | "properties": {}, 157 | "required": [] 158 | }, 159 | "security": [ 160 | { 161 | "apiToken": [] 162 | } 163 | ] 164 | }, 165 | { 166 | "name": "billing_cancelSubscriptionV1", 167 | "description": "This endpoint cancels a subscription and stops any further billing.", 168 | "method": "DELETE", 169 | "path": "/api/billing/v1/subscriptions/{subscriptionId}", 170 | "inputSchema": { 171 | "type": "object", 172 | "properties": { 173 | "subscriptionId": { 174 | "type": "string", 175 | "description": "Subscription ID" 176 | } 177 | }, 178 | "required": [ 179 | "subscriptionId" 180 | ] 181 | }, 182 | "security": [ 183 | { 184 | "apiToken": [] 185 | } 186 | ] 187 | }, 188 | { 189 | "name": "billing_getSubscriptionListV1", 190 | "description": "This endpoint retrieves a list of all subscriptions associated with your account.", 191 | "method": "GET", 192 | "path": "/api/billing/v1/subscriptions", 193 | "inputSchema": { 194 | "type": "object", 195 | "properties": {}, 196 | "required": [] 197 | }, 198 | "security": [ 199 | { 200 | "apiToken": [] 201 | } 202 | ] 203 | }, 204 | { 205 | "name": "DNS_getSnapshotV1", 206 | "description": "This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.", 207 | "method": "GET", 208 | "path": "/api/dns/v1/snapshots/{domain}/{snapshotId}", 209 | "inputSchema": { 210 | "type": "object", 211 | "properties": { 212 | "domain": { 213 | "type": "string", 214 | "description": "Domain name" 215 | }, 216 | "snapshotId": { 217 | "type": "integer", 218 | "description": "Snapshot ID" 219 | } 220 | }, 221 | "required": [ 222 | "domain", 223 | "snapshotId" 224 | ] 225 | }, 226 | "security": [ 227 | { 228 | "apiToken": [] 229 | } 230 | ] 231 | }, 232 | { 233 | "name": "DNS_getSnapshotListV1", 234 | "description": "This endpoint retrieves list of DNS snapshots.", 235 | "method": "GET", 236 | "path": "/api/dns/v1/snapshots/{domain}", 237 | "inputSchema": { 238 | "type": "object", 239 | "properties": { 240 | "domain": { 241 | "type": "string", 242 | "description": "Domain name" 243 | } 244 | }, 245 | "required": [ 246 | "domain" 247 | ] 248 | }, 249 | "security": [ 250 | { 251 | "apiToken": [] 252 | } 253 | ] 254 | }, 255 | { 256 | "name": "DNS_restoreSnapshotV1", 257 | "description": "This endpoint restores DNS zone to the selected snapshot.", 258 | "method": "POST", 259 | "path": "/api/dns/v1/snapshots/{domain}/{snapshotId}/restore", 260 | "inputSchema": { 261 | "type": "object", 262 | "properties": { 263 | "domain": { 264 | "type": "string", 265 | "description": "Domain name" 266 | }, 267 | "snapshotId": { 268 | "type": "integer", 269 | "description": "Snapshot ID" 270 | } 271 | }, 272 | "required": [ 273 | "domain", 274 | "snapshotId" 275 | ] 276 | }, 277 | "security": [ 278 | { 279 | "apiToken": [] 280 | } 281 | ] 282 | }, 283 | { 284 | "name": "DNS_getRecordsV1", 285 | "description": "This endpoint retrieves DNS zone records for a specific domain.", 286 | "method": "GET", 287 | "path": "/api/dns/v1/zones/{domain}", 288 | "inputSchema": { 289 | "type": "object", 290 | "properties": { 291 | "domain": { 292 | "type": "string", 293 | "description": "Domain name" 294 | } 295 | }, 296 | "required": [ 297 | "domain" 298 | ] 299 | }, 300 | "security": [ 301 | { 302 | "apiToken": [] 303 | } 304 | ] 305 | }, 306 | { 307 | "name": "DNS_updateZoneRecordsV1", 308 | "description": "This endpoint updates DNS records for the selected domain. \n\nUsing `overwrite = true` will replace existing records with the provided ones. \nOtherwise existing records will be updated and new records will be added.", 309 | "method": "PUT", 310 | "path": "/api/dns/v1/zones/{domain}", 311 | "inputSchema": { 312 | "type": "object", 313 | "properties": { 314 | "domain": { 315 | "type": "string", 316 | "description": "Domain name" 317 | }, 318 | "overwrite": { 319 | "type": "boolean", 320 | "description": "If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created." 321 | }, 322 | "zone": { 323 | "type": "array", 324 | "description": "zone parameter", 325 | "items": { 326 | "type": "object", 327 | "description": "zone parameter", 328 | "properties": { 329 | "name": { 330 | "type": "string", 331 | "description": "Name of the record (use `@` for wildcard name)" 332 | }, 333 | "records": { 334 | "type": "array", 335 | "description": "Records assigned to the name", 336 | "items": { 337 | "type": "object", 338 | "description": "records parameter", 339 | "properties": { 340 | "content": { 341 | "type": "string", 342 | "description": "Content of the name record" 343 | } 344 | }, 345 | "required": [ 346 | "content" 347 | ] 348 | } 349 | }, 350 | "ttl": { 351 | "type": "integer", 352 | "description": "TTL (Time-To-Live) of the record" 353 | }, 354 | "type": { 355 | "type": "string", 356 | "description": "Type of the record", 357 | "enum": [ 358 | "A", 359 | "AAAA", 360 | "CNAME", 361 | "ALIAS", 362 | "MX", 363 | "TXT", 364 | "NS", 365 | "SOA", 366 | "SRV", 367 | "CAA" 368 | ] 369 | } 370 | }, 371 | "required": [ 372 | "name", 373 | "records", 374 | "type" 375 | ] 376 | } 377 | } 378 | }, 379 | "required": [ 380 | "domain", 381 | "zone" 382 | ] 383 | }, 384 | "security": [ 385 | { 386 | "apiToken": [] 387 | } 388 | ] 389 | }, 390 | { 391 | "name": "DNS_deleteZoneRecordsV1", 392 | "description": "This endpoint deletes DNS records for the selected domain. \nTo filter which records to delete, add the `name` of the record and `type` to the filter. \nMultiple filters can be provided with single request.\n\nIf you have multiple records with the same name and type, and you want to delete only part of them,\nrefer to the `Update zone records` endpoint.", 393 | "method": "DELETE", 394 | "path": "/api/dns/v1/zones/{domain}", 395 | "inputSchema": { 396 | "type": "object", 397 | "properties": { 398 | "domain": { 399 | "type": "string", 400 | "description": "Domain name" 401 | } 402 | }, 403 | "required": [ 404 | "domain" 405 | ] 406 | }, 407 | "security": [ 408 | { 409 | "apiToken": [] 410 | } 411 | ] 412 | }, 413 | { 414 | "name": "DNS_resetZoneRecordsV1", 415 | "description": "This endpoint resets DNS zone to the default records.", 416 | "method": "POST", 417 | "path": "/api/dns/v1/zones/{domain}/reset", 418 | "inputSchema": { 419 | "type": "object", 420 | "properties": { 421 | "domain": { 422 | "type": "string", 423 | "description": "Domain name" 424 | }, 425 | "sync": { 426 | "type": "boolean", 427 | "description": "Determines if operation should be run synchronously" 428 | }, 429 | "reset_email_records": { 430 | "type": "boolean", 431 | "description": "Determines if email records should be reset" 432 | }, 433 | "whitelisted_record_types": { 434 | "type": "array", 435 | "description": "Specifies which record types to not reset", 436 | "items": { 437 | "type": "string", 438 | "description": "whitelisted_record_types parameter" 439 | } 440 | } 441 | }, 442 | "required": [ 443 | "domain" 444 | ] 445 | }, 446 | "security": [ 447 | { 448 | "apiToken": [] 449 | } 450 | ] 451 | }, 452 | { 453 | "name": "DNS_validateZoneRecordsV1", 454 | "description": "This endpoint used to validate DNS records prior update for the selected domain. \n\nIf the validation is successful, the response will contain `200 Success` code.\nIf there is validation error, the response will fail with `422 Validation error` code.", 455 | "method": "POST", 456 | "path": "/api/dns/v1/zones/{domain}/validate", 457 | "inputSchema": { 458 | "type": "object", 459 | "properties": { 460 | "domain": { 461 | "type": "string", 462 | "description": "Domain name" 463 | }, 464 | "overwrite": { 465 | "type": "boolean", 466 | "description": "If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created." 467 | }, 468 | "zone": { 469 | "type": "array", 470 | "description": "zone parameter", 471 | "items": { 472 | "type": "object", 473 | "description": "zone parameter", 474 | "properties": { 475 | "name": { 476 | "type": "string", 477 | "description": "Name of the record (use `@` for wildcard name)" 478 | }, 479 | "records": { 480 | "type": "array", 481 | "description": "Records assigned to the name", 482 | "items": { 483 | "type": "object", 484 | "description": "records parameter", 485 | "properties": { 486 | "content": { 487 | "type": "string", 488 | "description": "Content of the name record" 489 | } 490 | }, 491 | "required": [ 492 | "content" 493 | ] 494 | } 495 | }, 496 | "ttl": { 497 | "type": "integer", 498 | "description": "TTL (Time-To-Live) of the record" 499 | }, 500 | "type": { 501 | "type": "string", 502 | "description": "Type of the record", 503 | "enum": [ 504 | "A", 505 | "AAAA", 506 | "CNAME", 507 | "ALIAS", 508 | "MX", 509 | "TXT", 510 | "NS", 511 | "SOA", 512 | "SRV", 513 | "CAA" 514 | ] 515 | } 516 | }, 517 | "required": [ 518 | "name", 519 | "records", 520 | "type" 521 | ] 522 | } 523 | } 524 | }, 525 | "required": [ 526 | "domain", 527 | "zone" 528 | ] 529 | }, 530 | "security": [ 531 | { 532 | "apiToken": [] 533 | } 534 | ] 535 | }, 536 | { 537 | "name": "domains_checkDomainAvailabilityV1", 538 | "description": "This endpoint checks the availability of a domain name. Multiple TLDs can be checked at once.\nIf you want to get alternative domains with response, provide only one TLD in the request and set `with_alternatives` to `true`.\nTLDs should be provided without the leading dot (e.g. `com`, `net`, `org`).\n\nEndpoint has rate limit of 10 requests per minute.", 539 | "method": "POST", 540 | "path": "/api/domains/v1/availability", 541 | "inputSchema": { 542 | "type": "object", 543 | "properties": { 544 | "domain": { 545 | "type": "string", 546 | "description": "Domain name (without TLD)" 547 | }, 548 | "tlds": { 549 | "type": "array", 550 | "description": "TLDs list", 551 | "items": { 552 | "type": "string", 553 | "description": "TLD without leading dot" 554 | } 555 | }, 556 | "with_alternatives": { 557 | "type": "boolean", 558 | "description": "Should response include alternatives" 559 | } 560 | }, 561 | "required": [ 562 | "domain", 563 | "tlds" 564 | ] 565 | }, 566 | "security": [ 567 | { 568 | "apiToken": [] 569 | } 570 | ] 571 | }, 572 | { 573 | "name": "domains_getForwardingDataV1", 574 | "description": "This endpoint retrieves domain forwarding data.", 575 | "method": "GET", 576 | "path": "/api/domains/v1/forwarding/{domain}", 577 | "inputSchema": { 578 | "type": "object", 579 | "properties": { 580 | "domain": { 581 | "type": "string", 582 | "description": "Domain name" 583 | } 584 | }, 585 | "required": [ 586 | "domain" 587 | ] 588 | }, 589 | "security": [ 590 | { 591 | "apiToken": [] 592 | } 593 | ] 594 | }, 595 | { 596 | "name": "domains_deleteForwardingDataV1", 597 | "description": "This endpoint deletes domain forwarding data.", 598 | "method": "DELETE", 599 | "path": "/api/domains/v1/forwarding/{domain}", 600 | "inputSchema": { 601 | "type": "object", 602 | "properties": { 603 | "domain": { 604 | "type": "string", 605 | "description": "Domain name" 606 | } 607 | }, 608 | "required": [ 609 | "domain" 610 | ] 611 | }, 612 | "security": [ 613 | { 614 | "apiToken": [] 615 | } 616 | ] 617 | }, 618 | { 619 | "name": "domains_createForwardingDataV1", 620 | "description": "This endpoint creates domain forwarding data.", 621 | "method": "POST", 622 | "path": "/api/domains/v1/forwarding", 623 | "inputSchema": { 624 | "type": "object", 625 | "properties": { 626 | "domain": { 627 | "type": "string", 628 | "description": "Domain name" 629 | }, 630 | "redirect_type": { 631 | "type": "string", 632 | "description": "Redirect type", 633 | "enum": [ 634 | "301", 635 | "302" 636 | ] 637 | }, 638 | "redirect_url": { 639 | "type": "string", 640 | "description": "URL to forward domain to" 641 | } 642 | }, 643 | "required": [ 644 | "domain", 645 | "redirect_type", 646 | "redirect_url" 647 | ] 648 | }, 649 | "security": [ 650 | { 651 | "apiToken": [] 652 | } 653 | ] 654 | }, 655 | { 656 | "name": "domains_enableDomainLockV1", 657 | "description": "This endpoint enables domain lock for the domain. When domain lock is enabled, \nthe domain cannot be transferred to another registrar without first disabling the lock.", 658 | "method": "PUT", 659 | "path": "/api/domains/v1/portfolio/{domain}/domain-lock", 660 | "inputSchema": { 661 | "type": "object", 662 | "properties": { 663 | "domain": { 664 | "type": "string", 665 | "description": "Domain name" 666 | } 667 | }, 668 | "required": [ 669 | "domain" 670 | ] 671 | }, 672 | "security": [ 673 | { 674 | "apiToken": [] 675 | } 676 | ] 677 | }, 678 | { 679 | "name": "domains_disableDomainLockV1", 680 | "description": "This endpoint disables domain lock for the domain. Domain lock needs to be disabled \nbefore transferring the domain to another registrar.", 681 | "method": "DELETE", 682 | "path": "/api/domains/v1/portfolio/{domain}/domain-lock", 683 | "inputSchema": { 684 | "type": "object", 685 | "properties": { 686 | "domain": { 687 | "type": "string", 688 | "description": "Domain name" 689 | } 690 | }, 691 | "required": [ 692 | "domain" 693 | ] 694 | }, 695 | "security": [ 696 | { 697 | "apiToken": [] 698 | } 699 | ] 700 | }, 701 | { 702 | "name": "domains_getDomainV1", 703 | "description": "This endpoint retrieves details for specified domain.", 704 | "method": "GET", 705 | "path": "/api/domains/v1/portfolio/{domain}", 706 | "inputSchema": { 707 | "type": "object", 708 | "properties": { 709 | "domain": { 710 | "type": "string", 711 | "description": "Domain name" 712 | } 713 | }, 714 | "required": [ 715 | "domain" 716 | ] 717 | }, 718 | "security": [ 719 | { 720 | "apiToken": [] 721 | } 722 | ] 723 | }, 724 | { 725 | "name": "domains_getDomainListV1", 726 | "description": "This endpoint retrieves a list of all domains associated with your account.", 727 | "method": "GET", 728 | "path": "/api/domains/v1/portfolio", 729 | "inputSchema": { 730 | "type": "object", 731 | "properties": {}, 732 | "required": [] 733 | }, 734 | "security": [ 735 | { 736 | "apiToken": [] 737 | } 738 | ] 739 | }, 740 | { 741 | "name": "domains_purchaseNewDomainV1", 742 | "description": "This endpoint allows you to buy (purchase) and register a new domain name. \n\nIf registration fails, login to [hPanel](https://hpanel.hostinger.com/) and check the domain registration status.\n\nIf no payment method is provided, your default payment method will be used automatically.\n\nIf no WHOIS information is provided, the default contact information for that TLD (Top-Level Domain) will be used. \nBefore making a request, ensure that WHOIS information for the desired TLD exists in your account.\n\nSome TLDs require `additional_details` to be provided and these will be validated before completing the purchase. The required additional details vary by TLD.", 743 | "method": "POST", 744 | "path": "/api/domains/v1/portfolio", 745 | "inputSchema": { 746 | "type": "object", 747 | "properties": { 748 | "domain": { 749 | "type": "string", 750 | "description": "Domain name" 751 | }, 752 | "item_id": { 753 | "type": "string", 754 | "description": "Catalog price item ID" 755 | }, 756 | "payment_method_id": { 757 | "type": "integer", 758 | "description": "Payment method ID, default will be used if not provided" 759 | }, 760 | "domain_contacts": { 761 | "type": "object", 762 | "description": "Domain contact information", 763 | "properties": { 764 | "owner_id": { 765 | "type": "integer", 766 | "description": "Owner contact WHOIS record ID" 767 | }, 768 | "admin_id": { 769 | "type": "integer", 770 | "description": "Administrative contact WHOIS record ID" 771 | }, 772 | "billing_id": { 773 | "type": "integer", 774 | "description": "Billing contact WHOIS record ID" 775 | }, 776 | "tech_id": { 777 | "type": "integer", 778 | "description": "Technical contact WHOIS record ID" 779 | } 780 | } 781 | }, 782 | "additional_details": { 783 | "type": "object", 784 | "description": "Additional registration data, possible values depends on TLD", 785 | "properties": {} 786 | }, 787 | "coupons": { 788 | "type": "array", 789 | "description": "Discount coupon codes", 790 | "items": { 791 | "type": "string", 792 | "description": "coupons parameter" 793 | } 794 | } 795 | }, 796 | "required": [ 797 | "domain", 798 | "item_id" 799 | ] 800 | }, 801 | "security": [ 802 | { 803 | "apiToken": [] 804 | } 805 | ] 806 | }, 807 | { 808 | "name": "domains_enablePrivacyProtectionV1", 809 | "description": "This endpoint enables privacy protection for the domain.\nWhen privacy protection is enabled, the domain owner's personal information is hidden from the public WHOIS database.", 810 | "method": "PUT", 811 | "path": "/api/domains/v1/portfolio/{domain}/privacy-protection", 812 | "inputSchema": { 813 | "type": "object", 814 | "properties": { 815 | "domain": { 816 | "type": "string", 817 | "description": "Domain name" 818 | } 819 | }, 820 | "required": [ 821 | "domain" 822 | ] 823 | }, 824 | "security": [ 825 | { 826 | "apiToken": [] 827 | } 828 | ] 829 | }, 830 | { 831 | "name": "domains_disablePrivacyProtectionV1", 832 | "description": "This endpoint disables privacy protection for the domain.\nWhen privacy protection is disabled, the domain owner's personal information is visible in the public WHOIS database.", 833 | "method": "DELETE", 834 | "path": "/api/domains/v1/portfolio/{domain}/privacy-protection", 835 | "inputSchema": { 836 | "type": "object", 837 | "properties": { 838 | "domain": { 839 | "type": "string", 840 | "description": "Domain name" 841 | } 842 | }, 843 | "required": [ 844 | "domain" 845 | ] 846 | }, 847 | "security": [ 848 | { 849 | "apiToken": [] 850 | } 851 | ] 852 | }, 853 | { 854 | "name": "domains_updateNameserversV1", 855 | "description": "This endpoint sets the nameservers for a specified domain.\n\nBe aware, that improper nameserver configuration can lead to the domain being unresolvable or unavailable. ", 856 | "method": "PUT", 857 | "path": "/api/domains/v1/portfolio/{domain}/nameservers", 858 | "inputSchema": { 859 | "type": "object", 860 | "properties": { 861 | "domain": { 862 | "type": "string", 863 | "description": "Domain name" 864 | }, 865 | "ns1": { 866 | "type": "string", 867 | "description": "First name server" 868 | }, 869 | "ns2": { 870 | "type": "string", 871 | "description": "Second name server" 872 | }, 873 | "ns3": { 874 | "type": "string", 875 | "description": "Third name server" 876 | }, 877 | "ns4": { 878 | "type": "string", 879 | "description": "Fourth name server" 880 | } 881 | }, 882 | "required": [ 883 | "domain", 884 | "ns1", 885 | "ns2" 886 | ] 887 | }, 888 | "security": [ 889 | { 890 | "apiToken": [] 891 | } 892 | ] 893 | }, 894 | { 895 | "name": "domains_getWHOISProfileV1", 896 | "description": "This endpoint retrieves a WHOIS contact profile.", 897 | "method": "GET", 898 | "path": "/api/domains/v1/whois/{whoisId}", 899 | "inputSchema": { 900 | "type": "object", 901 | "properties": { 902 | "whoisId": { 903 | "type": "integer", 904 | "description": "WHOIS ID" 905 | } 906 | }, 907 | "required": [ 908 | "whoisId" 909 | ] 910 | }, 911 | "security": [ 912 | { 913 | "apiToken": [] 914 | } 915 | ] 916 | }, 917 | { 918 | "name": "domains_deleteWHOISProfileV1", 919 | "description": "This endpoint deletes WHOIS contact profile.", 920 | "method": "DELETE", 921 | "path": "/api/domains/v1/whois/{whoisId}", 922 | "inputSchema": { 923 | "type": "object", 924 | "properties": { 925 | "whoisId": { 926 | "type": "integer", 927 | "description": "WHOIS ID" 928 | } 929 | }, 930 | "required": [ 931 | "whoisId" 932 | ] 933 | }, 934 | "security": [ 935 | { 936 | "apiToken": [] 937 | } 938 | ] 939 | }, 940 | { 941 | "name": "domains_getWHOISProfileListV1", 942 | "description": "This endpoint retrieves a list of WHOIS contact profiles.", 943 | "method": "GET", 944 | "path": "/api/domains/v1/whois", 945 | "inputSchema": { 946 | "type": "object", 947 | "properties": { 948 | "tld": { 949 | "type": "string", 950 | "description": "Filter by TLD (without leading dot)" 951 | } 952 | }, 953 | "required": [] 954 | }, 955 | "security": [ 956 | { 957 | "apiToken": [] 958 | } 959 | ] 960 | }, 961 | { 962 | "name": "domains_createWHOISProfileV1", 963 | "description": "This endpoint creates WHOIS contact profile.", 964 | "method": "POST", 965 | "path": "/api/domains/v1/whois", 966 | "inputSchema": { 967 | "type": "object", 968 | "properties": { 969 | "tld": { 970 | "type": "string", 971 | "description": "TLD of the domain (without leading dot)" 972 | }, 973 | "country": { 974 | "type": "string", 975 | "description": "ISO 3166 2-letter country code" 976 | }, 977 | "entity_type": { 978 | "type": "string", 979 | "description": "Legal entity type", 980 | "enum": [ 981 | "individual", 982 | "organization" 983 | ] 984 | }, 985 | "tld_details": { 986 | "type": "object", 987 | "description": "TLD details", 988 | "properties": {} 989 | }, 990 | "whois_details": { 991 | "type": "object", 992 | "description": "WHOIS details", 993 | "properties": {} 994 | } 995 | }, 996 | "required": [ 997 | "tld", 998 | "entity_type", 999 | "country", 1000 | "whois_details" 1001 | ] 1002 | }, 1003 | "security": [ 1004 | { 1005 | "apiToken": [] 1006 | } 1007 | ] 1008 | }, 1009 | { 1010 | "name": "domains_getWHOISProfileUsageV1", 1011 | "description": "This endpoint retrieves a domain list where provided WHOIS contact profile is used.", 1012 | "method": "GET", 1013 | "path": "/api/domains/v1/whois/{whoisId}/usage", 1014 | "inputSchema": { 1015 | "type": "object", 1016 | "properties": { 1017 | "whoisId": { 1018 | "type": "integer", 1019 | "description": "WHOIS ID" 1020 | } 1021 | }, 1022 | "required": [ 1023 | "whoisId" 1024 | ] 1025 | }, 1026 | "security": [ 1027 | { 1028 | "apiToken": [] 1029 | } 1030 | ] 1031 | }, 1032 | { 1033 | "name": "VPS_getDataCentersListV1", 1034 | "description": "This endpoint retrieves a list of all data centers available.", 1035 | "method": "GET", 1036 | "path": "/api/vps/v1/data-centers", 1037 | "inputSchema": { 1038 | "type": "object", 1039 | "properties": {}, 1040 | "required": [] 1041 | }, 1042 | "security": [ 1043 | { 1044 | "apiToken": [] 1045 | } 1046 | ] 1047 | }, 1048 | { 1049 | "name": "VPS_activateFirewallV1", 1050 | "description": "This endpoint activates a firewall for a specified virtual machine. \n\nOnly one firewall can be active for a virtual machine at a time.", 1051 | "method": "POST", 1052 | "path": "/api/vps/v1/firewall/{firewallId}/activate/{virtualMachineId}", 1053 | "inputSchema": { 1054 | "type": "object", 1055 | "properties": { 1056 | "firewallId": { 1057 | "type": "integer", 1058 | "description": "Firewall ID" 1059 | }, 1060 | "virtualMachineId": { 1061 | "type": "integer", 1062 | "description": "Virtual Machine ID" 1063 | } 1064 | }, 1065 | "required": [ 1066 | "firewallId", 1067 | "virtualMachineId" 1068 | ] 1069 | }, 1070 | "security": [ 1071 | { 1072 | "apiToken": [] 1073 | } 1074 | ] 1075 | }, 1076 | { 1077 | "name": "VPS_deactivateFirewallV1", 1078 | "description": "This endpoint deactivates a firewall for a specified virtual machine.", 1079 | "method": "POST", 1080 | "path": "/api/vps/v1/firewall/{firewallId}/deactivate/{virtualMachineId}", 1081 | "inputSchema": { 1082 | "type": "object", 1083 | "properties": { 1084 | "firewallId": { 1085 | "type": "integer", 1086 | "description": "Firewall ID" 1087 | }, 1088 | "virtualMachineId": { 1089 | "type": "integer", 1090 | "description": "Virtual Machine ID" 1091 | } 1092 | }, 1093 | "required": [ 1094 | "firewallId", 1095 | "virtualMachineId" 1096 | ] 1097 | }, 1098 | "security": [ 1099 | { 1100 | "apiToken": [] 1101 | } 1102 | ] 1103 | }, 1104 | { 1105 | "name": "VPS_getFirewallV1", 1106 | "description": "This endpoint retrieves firewall by its ID and rules associated with it.", 1107 | "method": "GET", 1108 | "path": "/api/vps/v1/firewall/{firewallId}", 1109 | "inputSchema": { 1110 | "type": "object", 1111 | "properties": { 1112 | "firewallId": { 1113 | "type": "integer", 1114 | "description": "Firewall ID" 1115 | } 1116 | }, 1117 | "required": [ 1118 | "firewallId" 1119 | ] 1120 | }, 1121 | "security": [ 1122 | { 1123 | "apiToken": [] 1124 | } 1125 | ] 1126 | }, 1127 | { 1128 | "name": "VPS_deleteFirewallV1", 1129 | "description": "This endpoint deletes a specified firewall. \n\nAny virtual machine that has this firewall activated will automatically have it deactivated.", 1130 | "method": "DELETE", 1131 | "path": "/api/vps/v1/firewall/{firewallId}", 1132 | "inputSchema": { 1133 | "type": "object", 1134 | "properties": { 1135 | "firewallId": { 1136 | "type": "integer", 1137 | "description": "Firewall ID" 1138 | } 1139 | }, 1140 | "required": [ 1141 | "firewallId" 1142 | ] 1143 | }, 1144 | "security": [ 1145 | { 1146 | "apiToken": [] 1147 | } 1148 | ] 1149 | }, 1150 | { 1151 | "name": "VPS_getFirewallListV1", 1152 | "description": "This endpoint retrieves a list of all firewalls available.", 1153 | "method": "GET", 1154 | "path": "/api/vps/v1/firewall", 1155 | "inputSchema": { 1156 | "type": "object", 1157 | "properties": { 1158 | "page": { 1159 | "type": "integer", 1160 | "description": "Page number" 1161 | } 1162 | }, 1163 | "required": [] 1164 | }, 1165 | "security": [ 1166 | { 1167 | "apiToken": [] 1168 | } 1169 | ] 1170 | }, 1171 | { 1172 | "name": "VPS_createNewFirewallV1", 1173 | "description": "This endpoint creates a new firewall.", 1174 | "method": "POST", 1175 | "path": "/api/vps/v1/firewall", 1176 | "inputSchema": { 1177 | "type": "object", 1178 | "properties": { 1179 | "name": { 1180 | "type": "string", 1181 | "description": "name parameter" 1182 | } 1183 | }, 1184 | "required": [ 1185 | "name" 1186 | ] 1187 | }, 1188 | "security": [ 1189 | { 1190 | "apiToken": [] 1191 | } 1192 | ] 1193 | }, 1194 | { 1195 | "name": "VPS_updateFirewallRuleV1", 1196 | "description": "This endpoint updates a specific firewall rule from a specified firewall.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.", 1197 | "method": "PUT", 1198 | "path": "/api/vps/v1/firewall/{firewallId}/rules/{ruleId}", 1199 | "inputSchema": { 1200 | "type": "object", 1201 | "properties": { 1202 | "firewallId": { 1203 | "type": "integer", 1204 | "description": "Firewall ID" 1205 | }, 1206 | "ruleId": { 1207 | "type": "integer", 1208 | "description": "Firewall Rule ID" 1209 | }, 1210 | "protocol": { 1211 | "type": "string", 1212 | "description": "protocol parameter", 1213 | "enum": [ 1214 | "TCP", 1215 | "UDP", 1216 | "ICMP", 1217 | "GRE", 1218 | "any", 1219 | "ESP", 1220 | "AH", 1221 | "ICMPv6", 1222 | "SSH", 1223 | "HTTP", 1224 | "HTTPS", 1225 | "MySQL", 1226 | "PostgreSQL" 1227 | ] 1228 | }, 1229 | "port": { 1230 | "type": "string", 1231 | "description": "Port or port range, ex: 1024:2048" 1232 | }, 1233 | "source": { 1234 | "type": "string", 1235 | "description": "source parameter", 1236 | "enum": [ 1237 | "any", 1238 | "custom" 1239 | ] 1240 | }, 1241 | "source_detail": { 1242 | "type": "string", 1243 | "description": "IP range, CIDR, single IP or `any`" 1244 | } 1245 | }, 1246 | "required": [ 1247 | "firewallId", 1248 | "ruleId", 1249 | "protocol", 1250 | "port", 1251 | "source", 1252 | "source_detail" 1253 | ] 1254 | }, 1255 | "security": [ 1256 | { 1257 | "apiToken": [] 1258 | } 1259 | ] 1260 | }, 1261 | { 1262 | "name": "VPS_deleteFirewallRuleV1", 1263 | "description": "This endpoint deletes a specific firewall rule from a specified firewall.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.", 1264 | "method": "DELETE", 1265 | "path": "/api/vps/v1/firewall/{firewallId}/rules/{ruleId}", 1266 | "inputSchema": { 1267 | "type": "object", 1268 | "properties": { 1269 | "firewallId": { 1270 | "type": "integer", 1271 | "description": "Firewall ID" 1272 | }, 1273 | "ruleId": { 1274 | "type": "integer", 1275 | "description": "Firewall Rule ID" 1276 | } 1277 | }, 1278 | "required": [ 1279 | "firewallId", 1280 | "ruleId" 1281 | ] 1282 | }, 1283 | "security": [ 1284 | { 1285 | "apiToken": [] 1286 | } 1287 | ] 1288 | }, 1289 | { 1290 | "name": "VPS_createFirewallRuleV1", 1291 | "description": "This endpoint creates new firewall rule from a specified firewall. \nBy default, the firewall drops all incoming traffic, which means you must add accept rules for all ports you want to use.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.", 1292 | "method": "POST", 1293 | "path": "/api/vps/v1/firewall/{firewallId}/rules", 1294 | "inputSchema": { 1295 | "type": "object", 1296 | "properties": { 1297 | "firewallId": { 1298 | "type": "integer", 1299 | "description": "Firewall ID" 1300 | }, 1301 | "protocol": { 1302 | "type": "string", 1303 | "description": "protocol parameter", 1304 | "enum": [ 1305 | "TCP", 1306 | "UDP", 1307 | "ICMP", 1308 | "GRE", 1309 | "any", 1310 | "ESP", 1311 | "AH", 1312 | "ICMPv6", 1313 | "SSH", 1314 | "HTTP", 1315 | "HTTPS", 1316 | "MySQL", 1317 | "PostgreSQL" 1318 | ] 1319 | }, 1320 | "port": { 1321 | "type": "string", 1322 | "description": "Port or port range, ex: 1024:2048" 1323 | }, 1324 | "source": { 1325 | "type": "string", 1326 | "description": "source parameter", 1327 | "enum": [ 1328 | "any", 1329 | "custom" 1330 | ] 1331 | }, 1332 | "source_detail": { 1333 | "type": "string", 1334 | "description": "IP range, CIDR, single IP or `any`" 1335 | } 1336 | }, 1337 | "required": [ 1338 | "firewallId", 1339 | "protocol", 1340 | "port", 1341 | "source", 1342 | "source_detail" 1343 | ] 1344 | }, 1345 | "security": [ 1346 | { 1347 | "apiToken": [] 1348 | } 1349 | ] 1350 | }, 1351 | { 1352 | "name": "VPS_syncFirewallV1", 1353 | "description": "This endpoint syncs a firewall for a specified virtual machine.\n\nFirewall can loose sync with virtual machine if the firewall has new rules added, removed or updated.", 1354 | "method": "POST", 1355 | "path": "/api/vps/v1/firewall/{firewallId}/sync/{virtualMachineId}", 1356 | "inputSchema": { 1357 | "type": "object", 1358 | "properties": { 1359 | "firewallId": { 1360 | "type": "integer", 1361 | "description": "Firewall ID" 1362 | }, 1363 | "virtualMachineId": { 1364 | "type": "integer", 1365 | "description": "Virtual Machine ID" 1366 | } 1367 | }, 1368 | "required": [ 1369 | "firewallId", 1370 | "virtualMachineId" 1371 | ] 1372 | }, 1373 | "security": [ 1374 | { 1375 | "apiToken": [] 1376 | } 1377 | ] 1378 | }, 1379 | { 1380 | "name": "VPS_getPostInstallScriptV1", 1381 | "description": "This endpoint retrieves post-install script by its ID.", 1382 | "method": "GET", 1383 | "path": "/api/vps/v1/post-install-scripts/{postInstallScriptId}", 1384 | "inputSchema": { 1385 | "type": "object", 1386 | "properties": { 1387 | "postInstallScriptId": { 1388 | "type": "integer", 1389 | "description": "Post-install script ID" 1390 | } 1391 | }, 1392 | "required": [ 1393 | "postInstallScriptId" 1394 | ] 1395 | }, 1396 | "security": [ 1397 | { 1398 | "apiToken": [] 1399 | } 1400 | ] 1401 | }, 1402 | { 1403 | "name": "VPS_updatePostInstallScriptV1", 1404 | "description": "This endpoint updates a specific post-install script.", 1405 | "method": "PUT", 1406 | "path": "/api/vps/v1/post-install-scripts/{postInstallScriptId}", 1407 | "inputSchema": { 1408 | "type": "object", 1409 | "properties": { 1410 | "postInstallScriptId": { 1411 | "type": "integer", 1412 | "description": "Post-install script ID" 1413 | }, 1414 | "name": { 1415 | "type": "string", 1416 | "description": "Name of the script" 1417 | }, 1418 | "content": { 1419 | "type": "string", 1420 | "description": "Content of the script" 1421 | } 1422 | }, 1423 | "required": [ 1424 | "postInstallScriptId", 1425 | "name", 1426 | "content" 1427 | ] 1428 | }, 1429 | "security": [ 1430 | { 1431 | "apiToken": [] 1432 | } 1433 | ] 1434 | }, 1435 | { 1436 | "name": "VPS_deleteAPostInstallScriptV1", 1437 | "description": "This endpoint deletes a post-install script from your account. ", 1438 | "method": "DELETE", 1439 | "path": "/api/vps/v1/post-install-scripts/{postInstallScriptId}", 1440 | "inputSchema": { 1441 | "type": "object", 1442 | "properties": { 1443 | "postInstallScriptId": { 1444 | "type": "integer", 1445 | "description": "Post-install script ID" 1446 | } 1447 | }, 1448 | "required": [ 1449 | "postInstallScriptId" 1450 | ] 1451 | }, 1452 | "security": [ 1453 | { 1454 | "apiToken": [] 1455 | } 1456 | ] 1457 | }, 1458 | { 1459 | "name": "VPS_getPostInstallScriptListV1", 1460 | "description": "This endpoint retrieves a list of post-install scripts associated with your account.", 1461 | "method": "GET", 1462 | "path": "/api/vps/v1/post-install-scripts", 1463 | "inputSchema": { 1464 | "type": "object", 1465 | "properties": { 1466 | "page": { 1467 | "type": "integer", 1468 | "description": "Page number" 1469 | } 1470 | }, 1471 | "required": [] 1472 | }, 1473 | "security": [ 1474 | { 1475 | "apiToken": [] 1476 | } 1477 | ] 1478 | }, 1479 | { 1480 | "name": "VPS_createPostInstallScriptV1", 1481 | "description": "This endpoint allows you to add a new post-install script to your account, \nwhich can then be used run after the installation of a virtual machine instance.\n\nThe script contents will be saved to the file `/post_install` with executable attribute set and will be executed once virtual machine is installed.\nThe output of the script will be redirected to `/post_install.log`. Maximum script size is 48KB. ", 1482 | "method": "POST", 1483 | "path": "/api/vps/v1/post-install-scripts", 1484 | "inputSchema": { 1485 | "type": "object", 1486 | "properties": { 1487 | "name": { 1488 | "type": "string", 1489 | "description": "Name of the script" 1490 | }, 1491 | "content": { 1492 | "type": "string", 1493 | "description": "Content of the script" 1494 | } 1495 | }, 1496 | "required": [ 1497 | "name", 1498 | "content" 1499 | ] 1500 | }, 1501 | "security": [ 1502 | { 1503 | "apiToken": [] 1504 | } 1505 | ] 1506 | }, 1507 | { 1508 | "name": "VPS_attachPublicKeyV1", 1509 | "description": "This endpoint attaches an existing public keys from your account to a specified virtual machine.\n\nMultiple keys can be attached to a single virtual machine.", 1510 | "method": "POST", 1511 | "path": "/api/vps/v1/public-keys/attach/{virtualMachineId}", 1512 | "inputSchema": { 1513 | "type": "object", 1514 | "properties": { 1515 | "virtualMachineId": { 1516 | "type": "integer", 1517 | "description": "Virtual Machine ID" 1518 | }, 1519 | "ids": { 1520 | "type": "array", 1521 | "description": "Public Key IDs to attach", 1522 | "items": { 1523 | "type": "integer", 1524 | "description": "ids parameter" 1525 | } 1526 | } 1527 | }, 1528 | "required": [ 1529 | "virtualMachineId", 1530 | "ids" 1531 | ] 1532 | }, 1533 | "security": [ 1534 | { 1535 | "apiToken": [] 1536 | } 1537 | ] 1538 | }, 1539 | { 1540 | "name": "VPS_deleteAPublicKeyV1", 1541 | "description": "This endpoint deletes a public key from your account. \n\n**Deleting public key from account does not remove it from virtual machine** ", 1542 | "method": "DELETE", 1543 | "path": "/api/vps/v1/public-keys/{publicKeyId}", 1544 | "inputSchema": { 1545 | "type": "object", 1546 | "properties": { 1547 | "publicKeyId": { 1548 | "type": "integer", 1549 | "description": "Public Key ID" 1550 | } 1551 | }, 1552 | "required": [ 1553 | "publicKeyId" 1554 | ] 1555 | }, 1556 | "security": [ 1557 | { 1558 | "apiToken": [] 1559 | } 1560 | ] 1561 | }, 1562 | { 1563 | "name": "VPS_getPublicKeyListV1", 1564 | "description": "This endpoint retrieves a list of public keys associated with your account.", 1565 | "method": "GET", 1566 | "path": "/api/vps/v1/public-keys", 1567 | "inputSchema": { 1568 | "type": "object", 1569 | "properties": { 1570 | "page": { 1571 | "type": "integer", 1572 | "description": "Page number" 1573 | } 1574 | }, 1575 | "required": [] 1576 | }, 1577 | "security": [ 1578 | { 1579 | "apiToken": [] 1580 | } 1581 | ] 1582 | }, 1583 | { 1584 | "name": "VPS_createNewPublicKeyV1", 1585 | "description": "This endpoint allows you to add a new public key to your account, \nwhich can then be attached to virtual machine instances for secure access.", 1586 | "method": "POST", 1587 | "path": "/api/vps/v1/public-keys", 1588 | "inputSchema": { 1589 | "type": "object", 1590 | "properties": { 1591 | "name": { 1592 | "type": "string", 1593 | "description": "name parameter" 1594 | }, 1595 | "key": { 1596 | "type": "string", 1597 | "description": "key parameter" 1598 | } 1599 | }, 1600 | "required": [ 1601 | "name", 1602 | "key" 1603 | ] 1604 | }, 1605 | "security": [ 1606 | { 1607 | "apiToken": [] 1608 | } 1609 | ] 1610 | }, 1611 | { 1612 | "name": "VPS_getTemplateV1", 1613 | "description": "This endpoint retrieves details of a specific OS template for virtual machines.", 1614 | "method": "GET", 1615 | "path": "/api/vps/v1/templates/{templateId}", 1616 | "inputSchema": { 1617 | "type": "object", 1618 | "properties": { 1619 | "templateId": { 1620 | "type": "integer", 1621 | "description": "Template ID" 1622 | } 1623 | }, 1624 | "required": [ 1625 | "templateId" 1626 | ] 1627 | }, 1628 | "security": [ 1629 | { 1630 | "apiToken": [] 1631 | } 1632 | ] 1633 | }, 1634 | { 1635 | "name": "VPS_getTemplateListV1", 1636 | "description": "This endpoint retrieves a list of available OS templates for virtual machines.", 1637 | "method": "GET", 1638 | "path": "/api/vps/v1/templates", 1639 | "inputSchema": { 1640 | "type": "object", 1641 | "properties": {}, 1642 | "required": [] 1643 | }, 1644 | "security": [ 1645 | { 1646 | "apiToken": [] 1647 | } 1648 | ] 1649 | }, 1650 | { 1651 | "name": "VPS_getActionV1", 1652 | "description": "This endpoint retrieves details of a specific action performed on a specified virtual machine. \n\nThis endpoint allows you to view detailed information about a particular action, including the action name, timestamp, and status.", 1653 | "method": "GET", 1654 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/actions/{actionId}", 1655 | "inputSchema": { 1656 | "type": "object", 1657 | "properties": { 1658 | "virtualMachineId": { 1659 | "type": "integer", 1660 | "description": "Virtual Machine ID" 1661 | }, 1662 | "actionId": { 1663 | "type": "integer", 1664 | "description": "Action ID" 1665 | } 1666 | }, 1667 | "required": [ 1668 | "virtualMachineId", 1669 | "actionId" 1670 | ] 1671 | }, 1672 | "security": [ 1673 | { 1674 | "apiToken": [] 1675 | } 1676 | ] 1677 | }, 1678 | { 1679 | "name": "VPS_getActionListV1", 1680 | "description": "This endpoint retrieves a list of actions performed on a specified virtual machine.\n\nActions are operations or events that have been executed on the virtual machine, such as starting, stopping, or modifying \nthe machine. This endpoint allows you to view the history of these actions, providing details about each action, \nsuch as the action name, timestamp, and status.", 1681 | "method": "GET", 1682 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/actions", 1683 | "inputSchema": { 1684 | "type": "object", 1685 | "properties": { 1686 | "virtualMachineId": { 1687 | "type": "integer", 1688 | "description": "Virtual Machine ID" 1689 | }, 1690 | "page": { 1691 | "type": "integer", 1692 | "description": "Page number" 1693 | } 1694 | }, 1695 | "required": [ 1696 | "virtualMachineId" 1697 | ] 1698 | }, 1699 | "security": [ 1700 | { 1701 | "apiToken": [] 1702 | } 1703 | ] 1704 | }, 1705 | { 1706 | "name": "VPS_getAttachedPublicKeysV1", 1707 | "description": "This endpoint retrieves a list of public keys attached to a specified virtual machine.", 1708 | "method": "GET", 1709 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/public-keys", 1710 | "inputSchema": { 1711 | "type": "object", 1712 | "properties": { 1713 | "virtualMachineId": { 1714 | "type": "integer", 1715 | "description": "Virtual Machine ID" 1716 | }, 1717 | "page": { 1718 | "type": "integer", 1719 | "description": "Page number" 1720 | } 1721 | }, 1722 | "required": [ 1723 | "virtualMachineId" 1724 | ] 1725 | }, 1726 | "security": [ 1727 | { 1728 | "apiToken": [] 1729 | } 1730 | ] 1731 | }, 1732 | { 1733 | "name": "VPS_deleteBackupV1", 1734 | "description": "This endpoint deletes a specified backup for a virtual machine.", 1735 | "method": "DELETE", 1736 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/backups/{backupId}", 1737 | "inputSchema": { 1738 | "type": "object", 1739 | "properties": { 1740 | "virtualMachineId": { 1741 | "type": "integer", 1742 | "description": "Virtual Machine ID" 1743 | }, 1744 | "backupId": { 1745 | "type": "integer", 1746 | "description": "Backup ID" 1747 | } 1748 | }, 1749 | "required": [ 1750 | "virtualMachineId", 1751 | "backupId" 1752 | ] 1753 | }, 1754 | "security": [ 1755 | { 1756 | "apiToken": [] 1757 | } 1758 | ] 1759 | }, 1760 | { 1761 | "name": "VPS_getBackupListV1", 1762 | "description": "This endpoint retrieves a list of backups for a specified virtual machine.", 1763 | "method": "GET", 1764 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/backups", 1765 | "inputSchema": { 1766 | "type": "object", 1767 | "properties": { 1768 | "virtualMachineId": { 1769 | "type": "integer", 1770 | "description": "Virtual Machine ID" 1771 | }, 1772 | "page": { 1773 | "type": "integer", 1774 | "description": "Page number" 1775 | } 1776 | }, 1777 | "required": [ 1778 | "virtualMachineId" 1779 | ] 1780 | }, 1781 | "security": [ 1782 | { 1783 | "apiToken": [] 1784 | } 1785 | ] 1786 | }, 1787 | { 1788 | "name": "VPS_restoreBackupV1", 1789 | "description": "This endpoint restores a backup for a specified virtual machine.\n\nThe system will then initiate the restore process, which may take some time depending on the size of the backup.\n\n**All data on the virtual machine will be overwritten with the data from the backup.**", 1790 | "method": "POST", 1791 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/backups/{backupId}/restore", 1792 | "inputSchema": { 1793 | "type": "object", 1794 | "properties": { 1795 | "virtualMachineId": { 1796 | "type": "integer", 1797 | "description": "Virtual Machine ID" 1798 | }, 1799 | "backupId": { 1800 | "type": "integer", 1801 | "description": "Backup ID" 1802 | } 1803 | }, 1804 | "required": [ 1805 | "virtualMachineId", 1806 | "backupId" 1807 | ] 1808 | }, 1809 | "security": [ 1810 | { 1811 | "apiToken": [] 1812 | } 1813 | ] 1814 | }, 1815 | { 1816 | "name": "VPS_setHostnameV1", 1817 | "description": "This endpoint sets the hostname for a specified virtual machine. \nChanging hostname does not update PTR record automatically.\nIf you want your virtual machine to be reachable by a hostname, \nyou need to point your domain A/AAAA records to virtual machine IP as well.", 1818 | "method": "PUT", 1819 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/hostname", 1820 | "inputSchema": { 1821 | "type": "object", 1822 | "properties": { 1823 | "virtualMachineId": { 1824 | "type": "integer", 1825 | "description": "Virtual Machine ID" 1826 | }, 1827 | "hostname": { 1828 | "type": "string", 1829 | "description": "hostname parameter" 1830 | } 1831 | }, 1832 | "required": [ 1833 | "virtualMachineId", 1834 | "hostname" 1835 | ] 1836 | }, 1837 | "security": [ 1838 | { 1839 | "apiToken": [] 1840 | } 1841 | ] 1842 | }, 1843 | { 1844 | "name": "VPS_resetHostnameV1", 1845 | "description": "This endpoint resets the hostname and PTR record of a specified virtual machine to the default value.", 1846 | "method": "DELETE", 1847 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/hostname", 1848 | "inputSchema": { 1849 | "type": "object", 1850 | "properties": { 1851 | "virtualMachineId": { 1852 | "type": "integer", 1853 | "description": "Virtual Machine ID" 1854 | } 1855 | }, 1856 | "required": [ 1857 | "virtualMachineId" 1858 | ] 1859 | }, 1860 | "security": [ 1861 | { 1862 | "apiToken": [] 1863 | } 1864 | ] 1865 | }, 1866 | { 1867 | "name": "VPS_getVirtualMachineV1", 1868 | "description": "This endpoint retrieves detailed information about a specified virtual machine.", 1869 | "method": "GET", 1870 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}", 1871 | "inputSchema": { 1872 | "type": "object", 1873 | "properties": { 1874 | "virtualMachineId": { 1875 | "type": "integer", 1876 | "description": "Virtual Machine ID" 1877 | } 1878 | }, 1879 | "required": [ 1880 | "virtualMachineId" 1881 | ] 1882 | }, 1883 | "security": [ 1884 | { 1885 | "apiToken": [] 1886 | } 1887 | ] 1888 | }, 1889 | { 1890 | "name": "VPS_getVirtualMachineListV1", 1891 | "description": "This endpoint retrieves a list of all available virtual machines.", 1892 | "method": "GET", 1893 | "path": "/api/vps/v1/virtual-machines", 1894 | "inputSchema": { 1895 | "type": "object", 1896 | "properties": {}, 1897 | "required": [] 1898 | }, 1899 | "security": [ 1900 | { 1901 | "apiToken": [] 1902 | } 1903 | ] 1904 | }, 1905 | { 1906 | "name": "VPS_purchaseNewVirtualMachineV1", 1907 | "description": "This endpoint allows you to buy (purchase) and setup a new virtual machine.\n\nIf virtual machine setup fails for any reason, login to [hPanel](https://hpanel.hostinger.com/) and complete the setup manually.\n\nIf no payment method is provided, your default payment method will be used automatically. ", 1908 | "method": "POST", 1909 | "path": "/api/vps/v1/virtual-machines", 1910 | "inputSchema": { 1911 | "type": "object", 1912 | "properties": { 1913 | "item_id": { 1914 | "type": "string", 1915 | "description": "Catalog price item ID" 1916 | }, 1917 | "payment_method_id": { 1918 | "type": "integer", 1919 | "description": "Payment method ID, default will be used if not provided" 1920 | }, 1921 | "setup": { 1922 | "type": "string", 1923 | "description": "setup parameter" 1924 | }, 1925 | "coupons": { 1926 | "type": "array", 1927 | "description": "Discount coupon codes", 1928 | "items": { 1929 | "type": "string", 1930 | "description": "coupons parameter" 1931 | } 1932 | } 1933 | }, 1934 | "required": [ 1935 | "item_id", 1936 | "setup" 1937 | ] 1938 | }, 1939 | "security": [ 1940 | { 1941 | "apiToken": [] 1942 | } 1943 | ] 1944 | }, 1945 | { 1946 | "name": "VPS_getScanMetricsV1", 1947 | "description": "This endpoint retrieves the scan metrics for the [Monarx](https://www.monarx.com/) malware scanner installed on a specified virtual machine.\nThe scan metrics provide detailed information about the malware scans performed by Monarx, including the number of scans, \ndetected threats, and other relevant statistics. This information is useful for monitoring the security status of the \nvirtual machine and assessing the effectiveness of the malware scanner.", 1948 | "method": "GET", 1949 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", 1950 | "inputSchema": { 1951 | "type": "object", 1952 | "properties": { 1953 | "virtualMachineId": { 1954 | "type": "integer", 1955 | "description": "Virtual Machine ID" 1956 | } 1957 | }, 1958 | "required": [ 1959 | "virtualMachineId" 1960 | ] 1961 | }, 1962 | "security": [ 1963 | { 1964 | "apiToken": [] 1965 | } 1966 | ] 1967 | }, 1968 | { 1969 | "name": "VPS_installMonarxV1", 1970 | "description": "This endpoint installs the Monarx malware scanner on a specified virtual machine. \n\n[Monarx](https://www.monarx.com/) is a security tool designed to detect and prevent malware infections on virtual machines. \nBy installing Monarx, users can enhance the security of their virtual machines, ensuring that they are protected against malicious software.", 1971 | "method": "POST", 1972 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", 1973 | "inputSchema": { 1974 | "type": "object", 1975 | "properties": { 1976 | "virtualMachineId": { 1977 | "type": "integer", 1978 | "description": "Virtual Machine ID" 1979 | } 1980 | }, 1981 | "required": [ 1982 | "virtualMachineId" 1983 | ] 1984 | }, 1985 | "security": [ 1986 | { 1987 | "apiToken": [] 1988 | } 1989 | ] 1990 | }, 1991 | { 1992 | "name": "VPS_uninstallMonarxV1", 1993 | "description": "This endpoint uninstalls the Monarx malware scanner on a specified virtual machine.\nIf Monarx is not installed, the request will still be processed without any effect.", 1994 | "method": "DELETE", 1995 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/monarx", 1996 | "inputSchema": { 1997 | "type": "object", 1998 | "properties": { 1999 | "virtualMachineId": { 2000 | "type": "integer", 2001 | "description": "Virtual Machine ID" 2002 | } 2003 | }, 2004 | "required": [ 2005 | "virtualMachineId" 2006 | ] 2007 | }, 2008 | "security": [ 2009 | { 2010 | "apiToken": [] 2011 | } 2012 | ] 2013 | }, 2014 | { 2015 | "name": "VPS_getMetricsV1", 2016 | "description": "This endpoint retrieves the historical metrics for a specified virtual machine.\nIt includes the following metrics: \n- CPU usage\n- Memory usage\n- Disk usage\n- Network usage\n- Uptime", 2017 | "method": "GET", 2018 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/metrics", 2019 | "inputSchema": { 2020 | "type": "object", 2021 | "properties": { 2022 | "virtualMachineId": { 2023 | "type": "integer", 2024 | "description": "Virtual Machine ID" 2025 | }, 2026 | "date_from": { 2027 | "type": "string", 2028 | "description": "date_from parameter" 2029 | }, 2030 | "date_to": { 2031 | "type": "string", 2032 | "description": "date_to parameter" 2033 | } 2034 | }, 2035 | "required": [ 2036 | "virtualMachineId", 2037 | "date_from", 2038 | "date_to" 2039 | ] 2040 | }, 2041 | "security": [ 2042 | { 2043 | "apiToken": [] 2044 | } 2045 | ] 2046 | }, 2047 | { 2048 | "name": "VPS_setNameserversV1", 2049 | "description": "This endpoint sets the nameservers for a specified virtual machine.\nBe aware, that improper nameserver configuration can lead to the virtual machine being unable to resolve domain names.", 2050 | "method": "PUT", 2051 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/nameservers", 2052 | "inputSchema": { 2053 | "type": "object", 2054 | "properties": { 2055 | "virtualMachineId": { 2056 | "type": "integer", 2057 | "description": "Virtual Machine ID" 2058 | }, 2059 | "ns1": { 2060 | "type": "string", 2061 | "description": "ns1 parameter" 2062 | }, 2063 | "ns2": { 2064 | "type": "string", 2065 | "description": "ns2 parameter" 2066 | } 2067 | }, 2068 | "required": [ 2069 | "virtualMachineId", 2070 | "ns1" 2071 | ] 2072 | }, 2073 | "security": [ 2074 | { 2075 | "apiToken": [] 2076 | } 2077 | ] 2078 | }, 2079 | { 2080 | "name": "VPS_createPTRRecordV1", 2081 | "description": "This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine.", 2082 | "method": "POST", 2083 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/ptr", 2084 | "inputSchema": { 2085 | "type": "object", 2086 | "properties": { 2087 | "virtualMachineId": { 2088 | "type": "integer", 2089 | "description": "Virtual Machine ID" 2090 | } 2091 | }, 2092 | "required": [ 2093 | "virtualMachineId" 2094 | ] 2095 | }, 2096 | "security": [ 2097 | { 2098 | "apiToken": [] 2099 | } 2100 | ] 2101 | }, 2102 | { 2103 | "name": "VPS_deletePTRRecordV1", 2104 | "description": "This endpoint deletes a PTR (Pointer) record for a specified virtual machine. \n\nOnce deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname.", 2105 | "method": "DELETE", 2106 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/ptr", 2107 | "inputSchema": { 2108 | "type": "object", 2109 | "properties": { 2110 | "virtualMachineId": { 2111 | "type": "integer", 2112 | "description": "Virtual Machine ID" 2113 | } 2114 | }, 2115 | "required": [ 2116 | "virtualMachineId" 2117 | ] 2118 | }, 2119 | "security": [ 2120 | { 2121 | "apiToken": [] 2122 | } 2123 | ] 2124 | }, 2125 | { 2126 | "name": "VPS_setPanelPasswordV1", 2127 | "description": "This endpoint sets the panel password for a specified virtual machine. \nIf virtual machine does not use panel OS, the request will still be processed without any effect.\nRequirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate).", 2128 | "method": "PUT", 2129 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/panel-password", 2130 | "inputSchema": { 2131 | "type": "object", 2132 | "properties": { 2133 | "virtualMachineId": { 2134 | "type": "integer", 2135 | "description": "Virtual Machine ID" 2136 | }, 2137 | "password": { 2138 | "type": "string", 2139 | "description": "Panel password for the virtual machine" 2140 | } 2141 | }, 2142 | "required": [ 2143 | "virtualMachineId", 2144 | "password" 2145 | ] 2146 | }, 2147 | "security": [ 2148 | { 2149 | "apiToken": [] 2150 | } 2151 | ] 2152 | }, 2153 | { 2154 | "name": "VPS_startRecoveryModeV1", 2155 | "description": "This endpoint initiates the recovery mode for a specified virtual machine. \nRecovery mode is a special state that allows users to perform system rescue operations, \nsuch as repairing file systems, recovering data, or troubleshooting issues that prevent the virtual machine \nfrom booting normally. \n\nVirtual machine will boot recovery disk image and original disk image will be mounted in `/mnt` directory.", 2156 | "method": "POST", 2157 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery", 2158 | "inputSchema": { 2159 | "type": "object", 2160 | "properties": { 2161 | "virtualMachineId": { 2162 | "type": "integer", 2163 | "description": "Virtual Machine ID" 2164 | }, 2165 | "root_password": { 2166 | "type": "string", 2167 | "description": "Temporary root password for recovery mode" 2168 | } 2169 | }, 2170 | "required": [ 2171 | "virtualMachineId", 2172 | "root_password" 2173 | ] 2174 | }, 2175 | "security": [ 2176 | { 2177 | "apiToken": [] 2178 | } 2179 | ] 2180 | }, 2181 | { 2182 | "name": "VPS_stopRecoveryModeV1", 2183 | "description": "This endpoint stops the recovery mode for a specified virtual machine. \nIf virtual machine is not in recovery mode, this operation will fail.", 2184 | "method": "DELETE", 2185 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/recovery", 2186 | "inputSchema": { 2187 | "type": "object", 2188 | "properties": { 2189 | "virtualMachineId": { 2190 | "type": "integer", 2191 | "description": "Virtual Machine ID" 2192 | } 2193 | }, 2194 | "required": [ 2195 | "virtualMachineId" 2196 | ] 2197 | }, 2198 | "security": [ 2199 | { 2200 | "apiToken": [] 2201 | } 2202 | ] 2203 | }, 2204 | { 2205 | "name": "VPS_recreateVirtualMachineV1", 2206 | "description": "This endpoint will recreate a virtual machine from scratch. \nThe recreation process involves reinstalling the operating system and resetting the virtual machine to its initial state.\nSnapshots, if there are any, will be deleted.\n\n## Password Requirements\nPassword will be checked against leaked password databases. \nRequirements for the password are:\n- At least 8 characters long\n- At least one uppercase letter\n- At least one lowercase letter\n- At least one number\n- Is not leaked publicly\n\n**This operation is irreversible and will result in the loss of all data stored on the virtual machine!**", 2207 | "method": "POST", 2208 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/recreate", 2209 | "inputSchema": { 2210 | "type": "object", 2211 | "properties": { 2212 | "virtualMachineId": { 2213 | "type": "integer", 2214 | "description": "Virtual Machine ID" 2215 | }, 2216 | "template_id": { 2217 | "type": "integer", 2218 | "description": "Template ID" 2219 | }, 2220 | "password": { 2221 | "type": "string", 2222 | "description": "Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response." 2223 | }, 2224 | "post_install_script_id": { 2225 | "type": "integer", 2226 | "description": "Post-install script ID" 2227 | } 2228 | }, 2229 | "required": [ 2230 | "virtualMachineId", 2231 | "template_id" 2232 | ] 2233 | }, 2234 | "security": [ 2235 | { 2236 | "apiToken": [] 2237 | } 2238 | ] 2239 | }, 2240 | { 2241 | "name": "VPS_restartVirtualMachineV1", 2242 | "description": "This endpoint restarts a specified virtual machine. This is equivalent to fully stopping and starting the virtual machine.\nIf the virtual machine was stopped, it will be started.", 2243 | "method": "POST", 2244 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/restart", 2245 | "inputSchema": { 2246 | "type": "object", 2247 | "properties": { 2248 | "virtualMachineId": { 2249 | "type": "integer", 2250 | "description": "Virtual Machine ID" 2251 | } 2252 | }, 2253 | "required": [ 2254 | "virtualMachineId" 2255 | ] 2256 | }, 2257 | "security": [ 2258 | { 2259 | "apiToken": [] 2260 | } 2261 | ] 2262 | }, 2263 | { 2264 | "name": "VPS_setRootPasswordV1", 2265 | "description": "This endpoint sets the root password for a specified virtual machine. \nRequirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate).", 2266 | "method": "PUT", 2267 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/root-password", 2268 | "inputSchema": { 2269 | "type": "object", 2270 | "properties": { 2271 | "virtualMachineId": { 2272 | "type": "integer", 2273 | "description": "Virtual Machine ID" 2274 | }, 2275 | "password": { 2276 | "type": "string", 2277 | "description": "Root password for the virtual machine" 2278 | } 2279 | }, 2280 | "required": [ 2281 | "virtualMachineId", 2282 | "password" 2283 | ] 2284 | }, 2285 | "security": [ 2286 | { 2287 | "apiToken": [] 2288 | } 2289 | ] 2290 | }, 2291 | { 2292 | "name": "VPS_setupNewVirtualMachineV1", 2293 | "description": "This endpoint will setup newly purchased virtual machine with `initial` state. ", 2294 | "method": "POST", 2295 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/setup", 2296 | "inputSchema": { 2297 | "type": "object", 2298 | "properties": { 2299 | "virtualMachineId": { 2300 | "type": "integer", 2301 | "description": "Virtual Machine ID" 2302 | }, 2303 | "template_id": { 2304 | "type": "integer", 2305 | "description": "Template ID" 2306 | }, 2307 | "data_center_id": { 2308 | "type": "integer", 2309 | "description": "Data center ID" 2310 | }, 2311 | "post_install_script_id": { 2312 | "type": "integer", 2313 | "description": "Post-install script ID" 2314 | }, 2315 | "password": { 2316 | "type": "string", 2317 | "description": "Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response." 2318 | }, 2319 | "hostname": { 2320 | "type": "string", 2321 | "description": "Override default hostname of the virtual machine" 2322 | }, 2323 | "install_monarx": { 2324 | "type": "boolean", 2325 | "description": "Install Monarx malware scanner (if supported)" 2326 | }, 2327 | "enable_backups": { 2328 | "type": "boolean", 2329 | "description": "Enable weekly backup schedule" 2330 | }, 2331 | "ns1": { 2332 | "type": "string", 2333 | "description": "Name server 1" 2334 | }, 2335 | "ns2": { 2336 | "type": "string", 2337 | "description": "Name server 2" 2338 | }, 2339 | "public_key": { 2340 | "type": "object", 2341 | "description": "Use SSH key", 2342 | "properties": { 2343 | "name": { 2344 | "type": "string", 2345 | "description": "Name of the SSH key" 2346 | }, 2347 | "key": { 2348 | "type": "string", 2349 | "description": "Contents of the SSH key" 2350 | } 2351 | } 2352 | } 2353 | }, 2354 | "required": [ 2355 | "virtualMachineId", 2356 | "data_center_id", 2357 | "template_id" 2358 | ] 2359 | }, 2360 | "security": [ 2361 | { 2362 | "apiToken": [] 2363 | } 2364 | ] 2365 | }, 2366 | { 2367 | "name": "VPS_getSnapshotV1", 2368 | "description": "This endpoint retrieves a snapshot for a specified virtual machine.", 2369 | "method": "GET", 2370 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", 2371 | "inputSchema": { 2372 | "type": "object", 2373 | "properties": { 2374 | "virtualMachineId": { 2375 | "type": "integer", 2376 | "description": "Virtual Machine ID" 2377 | } 2378 | }, 2379 | "required": [ 2380 | "virtualMachineId" 2381 | ] 2382 | }, 2383 | "security": [ 2384 | { 2385 | "apiToken": [] 2386 | } 2387 | ] 2388 | }, 2389 | { 2390 | "name": "VPS_createSnapshotV1", 2391 | "description": "This endpoint creates a snapshot of a specified virtual machine. \nA snapshot captures the state and data of the virtual machine at a specific point in time, \nallowing users to restore the virtual machine to that state if needed. \nThis operation is useful for backup purposes, system recovery, \nand testing changes without affecting the current state of the virtual machine.\n\n**Creating new snapshot will overwrite the existing snapshot!**", 2392 | "method": "POST", 2393 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", 2394 | "inputSchema": { 2395 | "type": "object", 2396 | "properties": { 2397 | "virtualMachineId": { 2398 | "type": "integer", 2399 | "description": "Virtual Machine ID" 2400 | } 2401 | }, 2402 | "required": [ 2403 | "virtualMachineId" 2404 | ] 2405 | }, 2406 | "security": [ 2407 | { 2408 | "apiToken": [] 2409 | } 2410 | ] 2411 | }, 2412 | { 2413 | "name": "VPS_deleteSnapshotV1", 2414 | "description": "This endpoint deletes a snapshot of a specified virtual machine.", 2415 | "method": "DELETE", 2416 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot", 2417 | "inputSchema": { 2418 | "type": "object", 2419 | "properties": { 2420 | "virtualMachineId": { 2421 | "type": "integer", 2422 | "description": "Virtual Machine ID" 2423 | } 2424 | }, 2425 | "required": [ 2426 | "virtualMachineId" 2427 | ] 2428 | }, 2429 | "security": [ 2430 | { 2431 | "apiToken": [] 2432 | } 2433 | ] 2434 | }, 2435 | { 2436 | "name": "VPS_restoreSnapshotV1", 2437 | "description": "This endpoint restores a specified virtual machine to a previous state using a snapshot. \nRestoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing.", 2438 | "method": "POST", 2439 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/snapshot/restore", 2440 | "inputSchema": { 2441 | "type": "object", 2442 | "properties": { 2443 | "virtualMachineId": { 2444 | "type": "integer", 2445 | "description": "Virtual Machine ID" 2446 | } 2447 | }, 2448 | "required": [ 2449 | "virtualMachineId" 2450 | ] 2451 | }, 2452 | "security": [ 2453 | { 2454 | "apiToken": [] 2455 | } 2456 | ] 2457 | }, 2458 | { 2459 | "name": "VPS_startVirtualMachineV1", 2460 | "description": "This endpoint starts a specified virtual machine. \nIf the virtual machine is already running, the request will still be processed without any effect.", 2461 | "method": "POST", 2462 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/start", 2463 | "inputSchema": { 2464 | "type": "object", 2465 | "properties": { 2466 | "virtualMachineId": { 2467 | "type": "integer", 2468 | "description": "Virtual Machine ID" 2469 | } 2470 | }, 2471 | "required": [ 2472 | "virtualMachineId" 2473 | ] 2474 | }, 2475 | "security": [ 2476 | { 2477 | "apiToken": [] 2478 | } 2479 | ] 2480 | }, 2481 | { 2482 | "name": "VPS_stopVirtualMachineV1", 2483 | "description": "This endpoint stops a specified virtual machine. \nIf the virtual machine is already stopped, the request will still be processed without any effect.", 2484 | "method": "POST", 2485 | "path": "/api/vps/v1/virtual-machines/{virtualMachineId}/stop", 2486 | "inputSchema": { 2487 | "type": "object", 2488 | "properties": { 2489 | "virtualMachineId": { 2490 | "type": "integer", 2491 | "description": "Virtual Machine ID" 2492 | } 2493 | }, 2494 | "required": [ 2495 | "virtualMachineId" 2496 | ] 2497 | }, 2498 | "security": [ 2499 | { 2500 | "apiToken": [] 2501 | } 2502 | ] 2503 | } 2504 | ]; 2505 | const SECURITY_SCHEMES = { 2506 | "apiToken": { 2507 | "type": "http", 2508 | "description": "API Token authentication", 2509 | "scheme": "bearer" 2510 | } 2511 | }; 2512 | 2513 | /** 2514 | * MCP Server for Hostinger API 2515 | * Generated from OpenAPI spec version 0.0.60 2516 | */ 2517 | class MCPServer { 2518 | constructor() { 2519 | // Initialize class properties 2520 | this.server = null; 2521 | this.tools = new Map(); 2522 | this.debug = process.env.DEBUG === "true"; 2523 | this.baseUrl = process.env.API_BASE_URL || "https://developers.hostinger.com"; 2524 | this.headers = this.parseHeaders(process.env.API_HEADERS || ""); 2525 | 2526 | // Initialize tools map - do this before creating server 2527 | this.initializeTools(); 2528 | 2529 | // Create MCP server with correct capabilities 2530 | this.server = new Server( 2531 | { 2532 | name: "hostinger-api-mcp", 2533 | version: "0.0.22", 2534 | }, 2535 | { 2536 | capabilities: { 2537 | tools: {}, // Enable tools capability 2538 | }, 2539 | } 2540 | ); 2541 | 2542 | // Set up request handlers - don't log here 2543 | this.setupHandlers(); 2544 | } 2545 | 2546 | /** 2547 | * Parse headers from string 2548 | */ 2549 | parseHeaders(headerStr) { 2550 | const headers = {}; 2551 | if (headerStr) { 2552 | headerStr.split(",").forEach((header) => { 2553 | const [key, value] = header.split(":"); 2554 | if (key && value) headers[key.trim()] = value.trim(); 2555 | }); 2556 | } 2557 | 2558 | headers['User-Agent'] = 'hostinger-mcp-server/0.0.22'; 2559 | 2560 | return headers; 2561 | } 2562 | 2563 | /** 2564 | * Initialize tools map from OpenAPI spec 2565 | * This runs before the server is connected, so don't log here 2566 | */ 2567 | initializeTools() { 2568 | // Initialize each tool in the tools map 2569 | for (const tool of TOOLS) { 2570 | this.tools.set(tool.name, { 2571 | name: tool.name, 2572 | description: tool.description, 2573 | inputSchema: tool.inputSchema, 2574 | // Don't include security at the tool level 2575 | }); 2576 | } 2577 | 2578 | // Don't log here, we're not connected yet 2579 | console.error(`Initialized ${this.tools.size} tools`); 2580 | } 2581 | 2582 | /** 2583 | * Set up request handlers 2584 | */ 2585 | setupHandlers() { 2586 | // Handle tool listing requests 2587 | this.server.setRequestHandler(ListToolsRequestSchema, async () => { 2588 | this.log('debug', "Handling ListTools request"); 2589 | // Return tools in the format expected by MCP SDK 2590 | return { 2591 | tools: Array.from(this.tools.entries()).map(([id, tool]) => ({ 2592 | id, 2593 | ...tool, 2594 | })), 2595 | }; 2596 | }); 2597 | 2598 | // Handle tool execution requests 2599 | this.server.setRequestHandler(CallToolRequestSchema, async (request) => { 2600 | const { id, name, arguments: params } = request.params; 2601 | this.log('debug', "Handling CallTool request", { id, name, params }); 2602 | 2603 | let toolName; 2604 | let toolDetails; 2605 | 2606 | // Find the requested tool 2607 | for (const [tid, tool] of this.tools.entries()) { 2608 | if (tool.name === name) { 2609 | toolName = name; 2610 | break; 2611 | } 2612 | } 2613 | 2614 | if (!toolName) { 2615 | throw new Error(`Tool not found: ${name}`); 2616 | } 2617 | 2618 | toolDetails = TOOLS.find(t => t.name === toolName); 2619 | if (!toolDetails) { 2620 | throw new Error(`Tool details not found for ID: ${toolName}`); 2621 | } 2622 | 2623 | try { 2624 | this.log('info', `Executing tool: ${toolName}`); 2625 | 2626 | // Execute the API call 2627 | const result = await this.executeApiCall(toolDetails, params || {}); 2628 | 2629 | // Return the result in the correct MCP format 2630 | return { 2631 | content: [ 2632 | { 2633 | type: "text", 2634 | text: JSON.stringify(result) 2635 | } 2636 | ] 2637 | }; 2638 | 2639 | } catch (error) { 2640 | const errorMessage = error instanceof Error ? error.message : String(error); 2641 | const response = error.response; 2642 | this.log('error', `Error executing tool ${name}: ${errorMessage}`); 2643 | 2644 | throw error; 2645 | } 2646 | }); 2647 | } 2648 | 2649 | /** 2650 | * Execute an API call for a tool 2651 | */ 2652 | async executeApiCall(tool, params) { 2653 | // Get method and path from tool 2654 | const method = tool.method; 2655 | let path = tool.path; 2656 | 2657 | // Clone params to avoid modifying the original 2658 | const requestParams = { ...params }; 2659 | 2660 | // Replace path parameters with values from params 2661 | Object.entries(requestParams).forEach(([key, value]) => { 2662 | const placeholder = `{${key}}`; 2663 | if (path.includes(placeholder)) { 2664 | path = path.replace(placeholder, encodeURIComponent(String(value))); 2665 | delete requestParams[key]; // Remove used parameter 2666 | } 2667 | }); 2668 | 2669 | // Build the full URL 2670 | const baseUrl = this.baseUrl.endsWith("/") ? this.baseUrl : `${this.baseUrl}/`; 2671 | const cleanPath = path.startsWith("/") ? path.slice(1) : path; 2672 | const url = new URL(cleanPath, baseUrl).toString(); 2673 | 2674 | this.log('debug', `API Request: ${method} ${url}`); 2675 | 2676 | try { 2677 | // Configure the request 2678 | const config = { 2679 | method: method.toLowerCase(), 2680 | url, 2681 | headers: { ...this.headers }, 2682 | }; 2683 | 2684 | // Apply security headers based on tool security requirements 2685 | if (tool.security && Array.isArray(tool.security)) { 2686 | for (const requirement of tool.security) { 2687 | for (const securitySchemeName of Object.keys(requirement)) { 2688 | const securityDefinition = SECURITY_SCHEMES[securitySchemeName]; 2689 | 2690 | if (securityDefinition) { 2691 | const authType = securityDefinition.type; 2692 | 2693 | // Handle API key 2694 | if (authType === 'apiKey') { 2695 | const apiKeyName = securityDefinition.name; 2696 | const envVarName = `${securitySchemeName.toUpperCase()}_${apiKeyName.toUpperCase()}`; 2697 | const apiKeyValue = process.env[envVarName]; 2698 | 2699 | if (apiKeyValue) { 2700 | if (securityDefinition.in === 'header') { 2701 | config.headers[apiKeyName] = apiKeyValue; 2702 | } else if (securityDefinition.in === 'query') { 2703 | config.params = config.params || {}; 2704 | config.params[apiKeyName] = apiKeyValue; 2705 | } 2706 | } else { 2707 | this.log('warning', `API Key environment variable not found: ${envVarName}`); 2708 | } 2709 | } 2710 | // Handle bearer token 2711 | else if (authType === 'http' && securityDefinition.scheme === 'bearer') { 2712 | const envVarName = `${securitySchemeName.toUpperCase()}`; 2713 | const bearerToken = process.env[envVarName]; 2714 | 2715 | if (bearerToken) { 2716 | config.headers['Authorization'] = `Bearer ${bearerToken}`; 2717 | } else { 2718 | this.log('warning', `Bearer Token environment variable not found: ${envVarName}`); 2719 | } 2720 | } 2721 | // Handle basic auth 2722 | else if (authType === 'http' && securityDefinition.scheme === 'basic') { 2723 | const username = process.env[`${securitySchemeName.toUpperCase()}_USERNAME`]; 2724 | const password = process.env[`${securitySchemeName.toUpperCase()}_PASSWORD`]; 2725 | 2726 | if (username && password) { 2727 | const auth = Buffer.from(`${username}:${password}`).toString('base64'); 2728 | config.headers['Authorization'] = `Basic ${auth}`; 2729 | } else { 2730 | this.log('warning', `Basic auth credentials not found for ${securitySchemeName}`); 2731 | } 2732 | } 2733 | } 2734 | } 2735 | } 2736 | } 2737 | 2738 | // Add parameters based on request method 2739 | if (["GET", "DELETE"].includes(method)) { 2740 | // For GET/DELETE, send params as query string 2741 | config.params = { ...(config.params || {}), ...requestParams }; 2742 | } else { 2743 | // For POST/PUT/PATCH, send params as JSON body 2744 | config.data = requestParams; 2745 | config.headers["Content-Type"] = "application/json"; 2746 | } 2747 | 2748 | this.log('debug', "Request config:", { 2749 | url: config.url, 2750 | method: config.method, 2751 | params: config.params, 2752 | headers: Object.keys(config.headers) 2753 | }); 2754 | 2755 | // Execute the request 2756 | const response = await axios(config); 2757 | this.log('debug', `Response status: ${response.status}`); 2758 | 2759 | return response.data; 2760 | 2761 | } catch (error) { 2762 | const errorMessage = error instanceof Error ? error.message : String(error); 2763 | this.log('error', `API request failed: ${errorMessage}`); 2764 | 2765 | if (axios.isAxiosError(error)) { 2766 | const responseData = error.response?.data; 2767 | const responseStatus = error.response?.status; 2768 | 2769 | this.log('error', 'API Error Details:', { 2770 | status: responseStatus, 2771 | data: typeof responseData === 'object' ? JSON.stringify(responseData) : responseData 2772 | }); 2773 | 2774 | // Rethrow with more context for better error handling 2775 | const detailedError = new Error(`API request failed with status ${responseStatus}: ${errorMessage}`); 2776 | detailedError.response = error.response; 2777 | throw detailedError; 2778 | } 2779 | 2780 | throw error; 2781 | } 2782 | } 2783 | 2784 | /** 2785 | * Log messages with appropriate level 2786 | * Only sends to MCP if we're connected 2787 | */ 2788 | log(level, message, data) { 2789 | // Always log to stderr for visibility 2790 | console.error(`[${level.toUpperCase()}] ${message}${data ? ': ' + JSON.stringify(data) : ''}`); 2791 | 2792 | // Only try to send via MCP if we're in debug mode or it's important 2793 | if (this.debug || level !== 'debug') { 2794 | try { 2795 | // Only send if server exists and is connected 2796 | if (this.server && this.server.isConnected) { 2797 | this.server.sendLoggingMessage({ 2798 | level, 2799 | data: `[MCP Server] ${message}${data ? ': ' + JSON.stringify(data) : ''}` 2800 | }); 2801 | } 2802 | } catch (e) { 2803 | // If logging fails, log to stderr 2804 | console.error('Failed to send log via MCP:', e.message); 2805 | } 2806 | } 2807 | } 2808 | 2809 | /** 2810 | * Start the sse server 2811 | */ 2812 | async startSse(host, port) { 2813 | try { 2814 | // Create sse transport 2815 | const app = express(); 2816 | app.use(express.json()); 2817 | 2818 | let transport = null; 2819 | const sessions = {}; 2820 | 2821 | app.get('/sse', (req, res) => { 2822 | transport = new SSEServerTransport('/messages', res); 2823 | sessions[transport.sessionId] = transport; 2824 | 2825 | res.on('close', () => { 2826 | delete sessions[transport.sessionId]; 2827 | }); 2828 | 2829 | this.server.connect(transport); 2830 | }); 2831 | 2832 | app.post('/messages', (req, res) => { 2833 | const sessionId = req.query.sessionId; 2834 | const transport = sessions[sessionId]; 2835 | if (transport) { 2836 | transport.handlePostMessage(req, res); 2837 | } else { 2838 | res.status(400).send('No transport found for sessionId'); 2839 | } 2840 | }); 2841 | 2842 | app.listen(port, host); 2843 | this.log('info', `MCP Server with SSE transport started successfully with ${this.tools.size} tools`); 2844 | this.log('info', `Listening on ${host}:${port}`); 2845 | } catch (error) { 2846 | console.error("Failed to start MCP server:", error); 2847 | process.exit(1); 2848 | } 2849 | } 2850 | 2851 | /** 2852 | * Start the server 2853 | */ 2854 | async startStdio() { 2855 | try { 2856 | // Create stdio transport 2857 | const transport = new StdioServerTransport(); 2858 | console.error("MCP Server starting on stdio transport"); 2859 | 2860 | // Connect to the transport 2861 | await this.server.connect(transport); 2862 | 2863 | // Now we can safely log via MCP 2864 | console.error(`Registered ${this.tools.size} tools`); 2865 | this.log('info', `MCP Server with stdio transport started successfully with ${this.tools.size} tools`); 2866 | } catch (error) { 2867 | console.error("Failed to start MCP server:", error); 2868 | process.exit(1); 2869 | } 2870 | } 2871 | } 2872 | 2873 | // Start the server 2874 | async function main() { 2875 | try { 2876 | const argv = minimist(process.argv.slice(2), { 2877 | string: ['host'], 2878 | int: ['port'], 2879 | boolean: ['sse'], 2880 | default: { 2881 | host: '127.0.0.1', 2882 | port: 8100, 2883 | } 2884 | }); 2885 | 2886 | const server = new MCPServer(); 2887 | if (argv.sse) { 2888 | await server.startSse(argv.host, argv.port); 2889 | } else { 2890 | await server.startStdio(); 2891 | } 2892 | } catch (error) { 2893 | console.error("Failed to start server:", error); 2894 | process.exit(1); 2895 | } 2896 | } 2897 | 2898 | main(); 2899 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "esModuleInterop": true, 7 | "strict": true, 8 | "skipLibCheck": true, 9 | "forceConsistentCasingInFileNames": true, 10 | "outDir": "dist" 11 | }, 12 | "include": ["*.ts", "*.js"], 13 | "exclude": ["node_modules"] 14 | } 15 | -------------------------------------------------------------------------------- /types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Type definitions for the API endpoints 3 | * Auto-generated from OpenAPI specification 4 | */ 5 | 6 | export interface APITools { 7 | /** 8 | * This endpoint retrieves a list of catalog items available for order. 9 | 10 | Prices in catalog items is displayed as cents (without floating point), e.g: float `17.99` is displayed as integer `1799`. 11 | */ 12 | "undefined": { 13 | params: { 14 | /** 15 | * Filter catalog items by category 16 | */ 17 | category?: string; 18 | /** 19 | * Filter catalog items by name. Use `*` for wildcard search, e.g. `.COM*` to find .com domain 20 | */ 21 | name?: string; 22 | }; 23 | response: any; // Response structure will depend on the API 24 | }; 25 | 26 | /** 27 | * This endpoint creates a new service order. 28 | 29 | **DEPRECATED** 30 | 31 | To purchase a domain, use [`POST /api/domains/v1/portfolio`](/#tag/domains-portfolio/POST/api/domains/v1/portfolio) instead. 32 | 33 | To purchase a VPS, use [`POST /api/vps/v1/virtual-machines`](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines) instead. 34 | 35 | 36 | To place order, you need to provide payment method ID and list of price items from the catalog endpoint together with quantity. 37 | Coupons also can be provided during order creation. 38 | 39 | Orders created using this endpoint will be set for automatic renewal. 40 | 41 | Some `credit_card` payments might need additional verification, rendering purchase unprocessed. 42 | We recommend use other payment methods than `credit_card` if you encounter this issue. 43 | */ 44 | "undefined": { 45 | params: { 46 | /** 47 | * Payment method ID 48 | */ 49 | payment_method_id: number; 50 | /** 51 | * items parameter 52 | */ 53 | items: array; 54 | /** 55 | * Discount coupon codes 56 | */ 57 | coupons?: array; 58 | }; 59 | response: any; // Response structure will depend on the API 60 | }; 61 | 62 | /** 63 | * This endpoint sets default payment method for your account. 64 | */ 65 | "undefined": { 66 | params: { 67 | /** 68 | * Payment method ID 69 | */ 70 | paymentMethodId: number; 71 | }; 72 | response: any; // Response structure will depend on the API 73 | }; 74 | 75 | /** 76 | * This endpoint deletes a payment method from your account. 77 | */ 78 | "undefined": { 79 | params: { 80 | /** 81 | * Payment method ID 82 | */ 83 | paymentMethodId: number; 84 | }; 85 | response: any; // Response structure will depend on the API 86 | }; 87 | 88 | /** 89 | * This endpoint retrieves a list of available payment methods that can be used for placing new orders. 90 | 91 | If you want to add new payment method, please use [hPanel](https://hpanel.hostinger.com/billing/payment-methods). 92 | */ 93 | "undefined": { 94 | params: { 95 | 96 | }; 97 | response: any; // Response structure will depend on the API 98 | }; 99 | 100 | /** 101 | * This endpoint cancels a subscription and stops any further billing. 102 | */ 103 | "undefined": { 104 | params: { 105 | /** 106 | * Subscription ID 107 | */ 108 | subscriptionId: string; 109 | }; 110 | response: any; // Response structure will depend on the API 111 | }; 112 | 113 | /** 114 | * This endpoint retrieves a list of all subscriptions associated with your account. 115 | */ 116 | "undefined": { 117 | params: { 118 | 119 | }; 120 | response: any; // Response structure will depend on the API 121 | }; 122 | 123 | /** 124 | * This endpoint retrieves particular DNS snapshot with the contents of DNS zone records. 125 | */ 126 | "undefined": { 127 | params: { 128 | /** 129 | * Domain name 130 | */ 131 | domain: string; 132 | /** 133 | * Snapshot ID 134 | */ 135 | snapshotId: number; 136 | }; 137 | response: any; // Response structure will depend on the API 138 | }; 139 | 140 | /** 141 | * This endpoint retrieves list of DNS snapshots. 142 | */ 143 | "undefined": { 144 | params: { 145 | /** 146 | * Domain name 147 | */ 148 | domain: string; 149 | }; 150 | response: any; // Response structure will depend on the API 151 | }; 152 | 153 | /** 154 | * This endpoint restores DNS zone to the selected snapshot. 155 | */ 156 | "undefined": { 157 | params: { 158 | /** 159 | * Domain name 160 | */ 161 | domain: string; 162 | /** 163 | * Snapshot ID 164 | */ 165 | snapshotId: number; 166 | }; 167 | response: any; // Response structure will depend on the API 168 | }; 169 | 170 | /** 171 | * This endpoint retrieves DNS zone records for a specific domain. 172 | */ 173 | "undefined": { 174 | params: { 175 | /** 176 | * Domain name 177 | */ 178 | domain: string; 179 | }; 180 | response: any; // Response structure will depend on the API 181 | }; 182 | 183 | /** 184 | * This endpoint updates DNS records for the selected domain. 185 | 186 | Using `overwrite = true` will replace existing records with the provided ones. 187 | Otherwise existing records will be updated and new records will be added. 188 | */ 189 | "undefined": { 190 | params: { 191 | /** 192 | * Domain name 193 | */ 194 | domain: string; 195 | /** 196 | * If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created. 197 | */ 198 | overwrite?: boolean; 199 | /** 200 | * zone parameter 201 | */ 202 | zone: array; 203 | }; 204 | response: any; // Response structure will depend on the API 205 | }; 206 | 207 | /** 208 | * This endpoint deletes DNS records for the selected domain. 209 | To filter which records to delete, add the `name` of the record and `type` to the filter. 210 | Multiple filters can be provided with single request. 211 | 212 | If you have multiple records with the same name and type, and you want to delete only part of them, 213 | refer to the `Update zone records` endpoint. 214 | */ 215 | "undefined": { 216 | params: { 217 | /** 218 | * Domain name 219 | */ 220 | domain: string; 221 | }; 222 | response: any; // Response structure will depend on the API 223 | }; 224 | 225 | /** 226 | * This endpoint resets DNS zone to the default records. 227 | */ 228 | "undefined": { 229 | params: { 230 | /** 231 | * Domain name 232 | */ 233 | domain: string; 234 | /** 235 | * Determines if operation should be run synchronously 236 | */ 237 | sync?: boolean; 238 | /** 239 | * Determines if email records should be reset 240 | */ 241 | reset_email_records?: boolean; 242 | /** 243 | * Specifies which record types to not reset 244 | */ 245 | whitelisted_record_types?: array; 246 | }; 247 | response: any; // Response structure will depend on the API 248 | }; 249 | 250 | /** 251 | * This endpoint used to validate DNS records prior update for the selected domain. 252 | 253 | If the validation is successful, the response will contain `200 Success` code. 254 | If there is validation error, the response will fail with `422 Validation error` code. 255 | */ 256 | "undefined": { 257 | params: { 258 | /** 259 | * Domain name 260 | */ 261 | domain: string; 262 | /** 263 | * If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records' ttl's are updated and new records are appended. If no matching RRs are found, they are created. 264 | */ 265 | overwrite?: boolean; 266 | /** 267 | * zone parameter 268 | */ 269 | zone: array; 270 | }; 271 | response: any; // Response structure will depend on the API 272 | }; 273 | 274 | /** 275 | * This endpoint checks the availability of a domain name. Multiple TLDs can be checked at once. 276 | If you want to get alternative domains with response, provide only one TLD in the request and set `with_alternatives` to `true`. 277 | TLDs should be provided without the leading dot (e.g. `com`, `net`, `org`). 278 | 279 | Endpoint has rate limit of 10 requests per minute. 280 | */ 281 | "undefined": { 282 | params: { 283 | /** 284 | * Domain name (without TLD) 285 | */ 286 | domain: string; 287 | /** 288 | * TLDs list 289 | */ 290 | tlds: array; 291 | /** 292 | * Should response include alternatives 293 | */ 294 | with_alternatives?: boolean; 295 | }; 296 | response: any; // Response structure will depend on the API 297 | }; 298 | 299 | /** 300 | * This endpoint retrieves domain forwarding data. 301 | */ 302 | "undefined": { 303 | params: { 304 | /** 305 | * Domain name 306 | */ 307 | domain: string; 308 | }; 309 | response: any; // Response structure will depend on the API 310 | }; 311 | 312 | /** 313 | * This endpoint deletes domain forwarding data. 314 | */ 315 | "undefined": { 316 | params: { 317 | /** 318 | * Domain name 319 | */ 320 | domain: string; 321 | }; 322 | response: any; // Response structure will depend on the API 323 | }; 324 | 325 | /** 326 | * This endpoint creates domain forwarding data. 327 | */ 328 | "undefined": { 329 | params: { 330 | /** 331 | * Domain name 332 | */ 333 | domain: string; 334 | /** 335 | * Redirect type 336 | */ 337 | redirect_type: string; 338 | /** 339 | * URL to forward domain to 340 | */ 341 | redirect_url: string; 342 | }; 343 | response: any; // Response structure will depend on the API 344 | }; 345 | 346 | /** 347 | * This endpoint enables domain lock for the domain. When domain lock is enabled, 348 | the domain cannot be transferred to another registrar without first disabling the lock. 349 | */ 350 | "undefined": { 351 | params: { 352 | /** 353 | * Domain name 354 | */ 355 | domain: string; 356 | }; 357 | response: any; // Response structure will depend on the API 358 | }; 359 | 360 | /** 361 | * This endpoint disables domain lock for the domain. Domain lock needs to be disabled 362 | before transferring the domain to another registrar. 363 | */ 364 | "undefined": { 365 | params: { 366 | /** 367 | * Domain name 368 | */ 369 | domain: string; 370 | }; 371 | response: any; // Response structure will depend on the API 372 | }; 373 | 374 | /** 375 | * This endpoint retrieves details for specified domain. 376 | */ 377 | "undefined": { 378 | params: { 379 | /** 380 | * Domain name 381 | */ 382 | domain: string; 383 | }; 384 | response: any; // Response structure will depend on the API 385 | }; 386 | 387 | /** 388 | * This endpoint retrieves a list of all domains associated with your account. 389 | */ 390 | "undefined": { 391 | params: { 392 | 393 | }; 394 | response: any; // Response structure will depend on the API 395 | }; 396 | 397 | /** 398 | * This endpoint allows you to buy (purchase) and register a new domain name. 399 | 400 | If registration fails, login to [hPanel](https://hpanel.hostinger.com/) and check the domain registration status. 401 | 402 | If no payment method is provided, your default payment method will be used automatically. 403 | 404 | If no WHOIS information is provided, the default contact information for that TLD (Top-Level Domain) will be used. 405 | Before making a request, ensure that WHOIS information for the desired TLD exists in your account. 406 | 407 | Some TLDs require `additional_details` to be provided and these will be validated before completing the purchase. The required additional details vary by TLD. 408 | */ 409 | "undefined": { 410 | params: { 411 | /** 412 | * Domain name 413 | */ 414 | domain: string; 415 | /** 416 | * Catalog price item ID 417 | */ 418 | item_id: string; 419 | /** 420 | * Payment method ID, default will be used if not provided 421 | */ 422 | payment_method_id?: number; 423 | /** 424 | * Domain contact information 425 | */ 426 | domain_contacts?: object; 427 | /** 428 | * Additional registration data, possible values depends on TLD 429 | */ 430 | additional_details?: object; 431 | /** 432 | * Discount coupon codes 433 | */ 434 | coupons?: array; 435 | }; 436 | response: any; // Response structure will depend on the API 437 | }; 438 | 439 | /** 440 | * This endpoint enables privacy protection for the domain. 441 | When privacy protection is enabled, the domain owner's personal information is hidden from the public WHOIS database. 442 | */ 443 | "undefined": { 444 | params: { 445 | /** 446 | * Domain name 447 | */ 448 | domain: string; 449 | }; 450 | response: any; // Response structure will depend on the API 451 | }; 452 | 453 | /** 454 | * This endpoint disables privacy protection for the domain. 455 | When privacy protection is disabled, the domain owner's personal information is visible in the public WHOIS database. 456 | */ 457 | "undefined": { 458 | params: { 459 | /** 460 | * Domain name 461 | */ 462 | domain: string; 463 | }; 464 | response: any; // Response structure will depend on the API 465 | }; 466 | 467 | /** 468 | * This endpoint sets the nameservers for a specified domain. 469 | 470 | Be aware, that improper nameserver configuration can lead to the domain being unresolvable or unavailable. 471 | */ 472 | "undefined": { 473 | params: { 474 | /** 475 | * Domain name 476 | */ 477 | domain: string; 478 | /** 479 | * First name server 480 | */ 481 | ns1: string; 482 | /** 483 | * Second name server 484 | */ 485 | ns2: string; 486 | /** 487 | * Third name server 488 | */ 489 | ns3?: string; 490 | /** 491 | * Fourth name server 492 | */ 493 | ns4?: string; 494 | }; 495 | response: any; // Response structure will depend on the API 496 | }; 497 | 498 | /** 499 | * This endpoint retrieves a WHOIS contact profile. 500 | */ 501 | "undefined": { 502 | params: { 503 | /** 504 | * WHOIS ID 505 | */ 506 | whoisId: number; 507 | }; 508 | response: any; // Response structure will depend on the API 509 | }; 510 | 511 | /** 512 | * This endpoint deletes WHOIS contact profile. 513 | */ 514 | "undefined": { 515 | params: { 516 | /** 517 | * WHOIS ID 518 | */ 519 | whoisId: number; 520 | }; 521 | response: any; // Response structure will depend on the API 522 | }; 523 | 524 | /** 525 | * This endpoint retrieves a list of WHOIS contact profiles. 526 | */ 527 | "undefined": { 528 | params: { 529 | /** 530 | * Filter by TLD (without leading dot) 531 | */ 532 | tld?: string; 533 | }; 534 | response: any; // Response structure will depend on the API 535 | }; 536 | 537 | /** 538 | * This endpoint creates WHOIS contact profile. 539 | */ 540 | "undefined": { 541 | params: { 542 | /** 543 | * TLD of the domain (without leading dot) 544 | */ 545 | tld: string; 546 | /** 547 | * ISO 3166 2-letter country code 548 | */ 549 | country: string; 550 | /** 551 | * Legal entity type 552 | */ 553 | entity_type: string; 554 | /** 555 | * TLD details 556 | */ 557 | tld_details?: object; 558 | /** 559 | * WHOIS details 560 | */ 561 | whois_details: object; 562 | }; 563 | response: any; // Response structure will depend on the API 564 | }; 565 | 566 | /** 567 | * This endpoint retrieves a domain list where provided WHOIS contact profile is used. 568 | */ 569 | "undefined": { 570 | params: { 571 | /** 572 | * WHOIS ID 573 | */ 574 | whoisId: number; 575 | }; 576 | response: any; // Response structure will depend on the API 577 | }; 578 | 579 | /** 580 | * This endpoint retrieves a list of all data centers available. 581 | */ 582 | "undefined": { 583 | params: { 584 | 585 | }; 586 | response: any; // Response structure will depend on the API 587 | }; 588 | 589 | /** 590 | * This endpoint activates a firewall for a specified virtual machine. 591 | 592 | Only one firewall can be active for a virtual machine at a time. 593 | */ 594 | "undefined": { 595 | params: { 596 | /** 597 | * Firewall ID 598 | */ 599 | firewallId: number; 600 | /** 601 | * Virtual Machine ID 602 | */ 603 | virtualMachineId: number; 604 | }; 605 | response: any; // Response structure will depend on the API 606 | }; 607 | 608 | /** 609 | * This endpoint deactivates a firewall for a specified virtual machine. 610 | */ 611 | "undefined": { 612 | params: { 613 | /** 614 | * Firewall ID 615 | */ 616 | firewallId: number; 617 | /** 618 | * Virtual Machine ID 619 | */ 620 | virtualMachineId: number; 621 | }; 622 | response: any; // Response structure will depend on the API 623 | }; 624 | 625 | /** 626 | * This endpoint retrieves firewall by its ID and rules associated with it. 627 | */ 628 | "undefined": { 629 | params: { 630 | /** 631 | * Firewall ID 632 | */ 633 | firewallId: number; 634 | }; 635 | response: any; // Response structure will depend on the API 636 | }; 637 | 638 | /** 639 | * This endpoint deletes a specified firewall. 640 | 641 | Any virtual machine that has this firewall activated will automatically have it deactivated. 642 | */ 643 | "undefined": { 644 | params: { 645 | /** 646 | * Firewall ID 647 | */ 648 | firewallId: number; 649 | }; 650 | response: any; // Response structure will depend on the API 651 | }; 652 | 653 | /** 654 | * This endpoint retrieves a list of all firewalls available. 655 | */ 656 | "undefined": { 657 | params: { 658 | /** 659 | * Page number 660 | */ 661 | page?: number; 662 | }; 663 | response: any; // Response structure will depend on the API 664 | }; 665 | 666 | /** 667 | * This endpoint creates a new firewall. 668 | */ 669 | "undefined": { 670 | params: { 671 | /** 672 | * name parameter 673 | */ 674 | name: string; 675 | }; 676 | response: any; // Response structure will depend on the API 677 | }; 678 | 679 | /** 680 | * This endpoint updates a specific firewall rule from a specified firewall. 681 | 682 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 683 | */ 684 | "undefined": { 685 | params: { 686 | /** 687 | * Firewall ID 688 | */ 689 | firewallId: number; 690 | /** 691 | * Firewall Rule ID 692 | */ 693 | ruleId: number; 694 | /** 695 | * protocol parameter 696 | */ 697 | protocol: string; 698 | /** 699 | * Port or port range, ex: 1024:2048 700 | */ 701 | port: string; 702 | /** 703 | * source parameter 704 | */ 705 | source: string; 706 | /** 707 | * IP range, CIDR, single IP or `any` 708 | */ 709 | source_detail: string; 710 | }; 711 | response: any; // Response structure will depend on the API 712 | }; 713 | 714 | /** 715 | * This endpoint deletes a specific firewall rule from a specified firewall. 716 | 717 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 718 | */ 719 | "undefined": { 720 | params: { 721 | /** 722 | * Firewall ID 723 | */ 724 | firewallId: number; 725 | /** 726 | * Firewall Rule ID 727 | */ 728 | ruleId: number; 729 | }; 730 | response: any; // Response structure will depend on the API 731 | }; 732 | 733 | /** 734 | * This endpoint creates new firewall rule from a specified firewall. 735 | By default, the firewall drops all incoming traffic, which means you must add accept rules for all ports you want to use. 736 | 737 | Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually. 738 | */ 739 | "undefined": { 740 | params: { 741 | /** 742 | * Firewall ID 743 | */ 744 | firewallId: number; 745 | /** 746 | * protocol parameter 747 | */ 748 | protocol: string; 749 | /** 750 | * Port or port range, ex: 1024:2048 751 | */ 752 | port: string; 753 | /** 754 | * source parameter 755 | */ 756 | source: string; 757 | /** 758 | * IP range, CIDR, single IP or `any` 759 | */ 760 | source_detail: string; 761 | }; 762 | response: any; // Response structure will depend on the API 763 | }; 764 | 765 | /** 766 | * This endpoint syncs a firewall for a specified virtual machine. 767 | 768 | Firewall can loose sync with virtual machine if the firewall has new rules added, removed or updated. 769 | */ 770 | "undefined": { 771 | params: { 772 | /** 773 | * Firewall ID 774 | */ 775 | firewallId: number; 776 | /** 777 | * Virtual Machine ID 778 | */ 779 | virtualMachineId: number; 780 | }; 781 | response: any; // Response structure will depend on the API 782 | }; 783 | 784 | /** 785 | * This endpoint retrieves post-install script by its ID. 786 | */ 787 | "undefined": { 788 | params: { 789 | /** 790 | * Post-install script ID 791 | */ 792 | postInstallScriptId: number; 793 | }; 794 | response: any; // Response structure will depend on the API 795 | }; 796 | 797 | /** 798 | * This endpoint updates a specific post-install script. 799 | */ 800 | "undefined": { 801 | params: { 802 | /** 803 | * Post-install script ID 804 | */ 805 | postInstallScriptId: number; 806 | /** 807 | * Name of the script 808 | */ 809 | name: string; 810 | /** 811 | * Content of the script 812 | */ 813 | content: string; 814 | }; 815 | response: any; // Response structure will depend on the API 816 | }; 817 | 818 | /** 819 | * This endpoint deletes a post-install script from your account. 820 | */ 821 | "undefined": { 822 | params: { 823 | /** 824 | * Post-install script ID 825 | */ 826 | postInstallScriptId: number; 827 | }; 828 | response: any; // Response structure will depend on the API 829 | }; 830 | 831 | /** 832 | * This endpoint retrieves a list of post-install scripts associated with your account. 833 | */ 834 | "undefined": { 835 | params: { 836 | /** 837 | * Page number 838 | */ 839 | page?: number; 840 | }; 841 | response: any; // Response structure will depend on the API 842 | }; 843 | 844 | /** 845 | * This endpoint allows you to add a new post-install script to your account, 846 | which can then be used run after the installation of a virtual machine instance. 847 | 848 | The script contents will be saved to the file `/post_install` with executable attribute set and will be executed once virtual machine is installed. 849 | The output of the script will be redirected to `/post_install.log`. Maximum script size is 48KB. 850 | */ 851 | "undefined": { 852 | params: { 853 | /** 854 | * Name of the script 855 | */ 856 | name: string; 857 | /** 858 | * Content of the script 859 | */ 860 | content: string; 861 | }; 862 | response: any; // Response structure will depend on the API 863 | }; 864 | 865 | /** 866 | * This endpoint attaches an existing public keys from your account to a specified virtual machine. 867 | 868 | Multiple keys can be attached to a single virtual machine. 869 | */ 870 | "undefined": { 871 | params: { 872 | /** 873 | * Virtual Machine ID 874 | */ 875 | virtualMachineId: number; 876 | /** 877 | * Public Key IDs to attach 878 | */ 879 | ids: array; 880 | }; 881 | response: any; // Response structure will depend on the API 882 | }; 883 | 884 | /** 885 | * This endpoint deletes a public key from your account. 886 | 887 | **Deleting public key from account does not remove it from virtual machine** 888 | */ 889 | "undefined": { 890 | params: { 891 | /** 892 | * Public Key ID 893 | */ 894 | publicKeyId: number; 895 | }; 896 | response: any; // Response structure will depend on the API 897 | }; 898 | 899 | /** 900 | * This endpoint retrieves a list of public keys associated with your account. 901 | */ 902 | "undefined": { 903 | params: { 904 | /** 905 | * Page number 906 | */ 907 | page?: number; 908 | }; 909 | response: any; // Response structure will depend on the API 910 | }; 911 | 912 | /** 913 | * This endpoint allows you to add a new public key to your account, 914 | which can then be attached to virtual machine instances for secure access. 915 | */ 916 | "undefined": { 917 | params: { 918 | /** 919 | * name parameter 920 | */ 921 | name: string; 922 | /** 923 | * key parameter 924 | */ 925 | key: string; 926 | }; 927 | response: any; // Response structure will depend on the API 928 | }; 929 | 930 | /** 931 | * This endpoint retrieves details of a specific OS template for virtual machines. 932 | */ 933 | "undefined": { 934 | params: { 935 | /** 936 | * Template ID 937 | */ 938 | templateId: number; 939 | }; 940 | response: any; // Response structure will depend on the API 941 | }; 942 | 943 | /** 944 | * This endpoint retrieves a list of available OS templates for virtual machines. 945 | */ 946 | "undefined": { 947 | params: { 948 | 949 | }; 950 | response: any; // Response structure will depend on the API 951 | }; 952 | 953 | /** 954 | * This endpoint retrieves details of a specific action performed on a specified virtual machine. 955 | 956 | This endpoint allows you to view detailed information about a particular action, including the action name, timestamp, and status. 957 | */ 958 | "undefined": { 959 | params: { 960 | /** 961 | * Virtual Machine ID 962 | */ 963 | virtualMachineId: number; 964 | /** 965 | * Action ID 966 | */ 967 | actionId: number; 968 | }; 969 | response: any; // Response structure will depend on the API 970 | }; 971 | 972 | /** 973 | * This endpoint retrieves a list of actions performed on a specified virtual machine. 974 | 975 | Actions are operations or events that have been executed on the virtual machine, such as starting, stopping, or modifying 976 | the machine. This endpoint allows you to view the history of these actions, providing details about each action, 977 | such as the action name, timestamp, and status. 978 | */ 979 | "undefined": { 980 | params: { 981 | /** 982 | * Virtual Machine ID 983 | */ 984 | virtualMachineId: number; 985 | /** 986 | * Page number 987 | */ 988 | page?: number; 989 | }; 990 | response: any; // Response structure will depend on the API 991 | }; 992 | 993 | /** 994 | * This endpoint retrieves a list of public keys attached to a specified virtual machine. 995 | */ 996 | "undefined": { 997 | params: { 998 | /** 999 | * Virtual Machine ID 1000 | */ 1001 | virtualMachineId: number; 1002 | /** 1003 | * Page number 1004 | */ 1005 | page?: number; 1006 | }; 1007 | response: any; // Response structure will depend on the API 1008 | }; 1009 | 1010 | /** 1011 | * This endpoint deletes a specified backup for a virtual machine. 1012 | */ 1013 | "undefined": { 1014 | params: { 1015 | /** 1016 | * Virtual Machine ID 1017 | */ 1018 | virtualMachineId: number; 1019 | /** 1020 | * Backup ID 1021 | */ 1022 | backupId: number; 1023 | }; 1024 | response: any; // Response structure will depend on the API 1025 | }; 1026 | 1027 | /** 1028 | * This endpoint retrieves a list of backups for a specified virtual machine. 1029 | */ 1030 | "undefined": { 1031 | params: { 1032 | /** 1033 | * Virtual Machine ID 1034 | */ 1035 | virtualMachineId: number; 1036 | /** 1037 | * Page number 1038 | */ 1039 | page?: number; 1040 | }; 1041 | response: any; // Response structure will depend on the API 1042 | }; 1043 | 1044 | /** 1045 | * This endpoint restores a backup for a specified virtual machine. 1046 | 1047 | The system will then initiate the restore process, which may take some time depending on the size of the backup. 1048 | 1049 | **All data on the virtual machine will be overwritten with the data from the backup.** 1050 | */ 1051 | "undefined": { 1052 | params: { 1053 | /** 1054 | * Virtual Machine ID 1055 | */ 1056 | virtualMachineId: number; 1057 | /** 1058 | * Backup ID 1059 | */ 1060 | backupId: number; 1061 | }; 1062 | response: any; // Response structure will depend on the API 1063 | }; 1064 | 1065 | /** 1066 | * This endpoint sets the hostname for a specified virtual machine. 1067 | Changing hostname does not update PTR record automatically. 1068 | If you want your virtual machine to be reachable by a hostname, 1069 | you need to point your domain A/AAAA records to virtual machine IP as well. 1070 | */ 1071 | "undefined": { 1072 | params: { 1073 | /** 1074 | * Virtual Machine ID 1075 | */ 1076 | virtualMachineId: number; 1077 | /** 1078 | * hostname parameter 1079 | */ 1080 | hostname: string; 1081 | }; 1082 | response: any; // Response structure will depend on the API 1083 | }; 1084 | 1085 | /** 1086 | * This endpoint resets the hostname and PTR record of a specified virtual machine to the default value. 1087 | */ 1088 | "undefined": { 1089 | params: { 1090 | /** 1091 | * Virtual Machine ID 1092 | */ 1093 | virtualMachineId: number; 1094 | }; 1095 | response: any; // Response structure will depend on the API 1096 | }; 1097 | 1098 | /** 1099 | * This endpoint retrieves detailed information about a specified virtual machine. 1100 | */ 1101 | "undefined": { 1102 | params: { 1103 | /** 1104 | * Virtual Machine ID 1105 | */ 1106 | virtualMachineId: number; 1107 | }; 1108 | response: any; // Response structure will depend on the API 1109 | }; 1110 | 1111 | /** 1112 | * This endpoint retrieves a list of all available virtual machines. 1113 | */ 1114 | "undefined": { 1115 | params: { 1116 | 1117 | }; 1118 | response: any; // Response structure will depend on the API 1119 | }; 1120 | 1121 | /** 1122 | * This endpoint allows you to buy (purchase) and setup a new virtual machine. 1123 | 1124 | If virtual machine setup fails for any reason, login to [hPanel](https://hpanel.hostinger.com/) and complete the setup manually. 1125 | 1126 | If no payment method is provided, your default payment method will be used automatically. 1127 | */ 1128 | "undefined": { 1129 | params: { 1130 | /** 1131 | * Catalog price item ID 1132 | */ 1133 | item_id: string; 1134 | /** 1135 | * Payment method ID, default will be used if not provided 1136 | */ 1137 | payment_method_id?: number; 1138 | /** 1139 | * setup parameter 1140 | */ 1141 | setup: string; 1142 | /** 1143 | * Discount coupon codes 1144 | */ 1145 | coupons?: array; 1146 | }; 1147 | response: any; // Response structure will depend on the API 1148 | }; 1149 | 1150 | /** 1151 | * This endpoint retrieves the scan metrics for the [Monarx](https://www.monarx.com/) malware scanner installed on a specified virtual machine. 1152 | The scan metrics provide detailed information about the malware scans performed by Monarx, including the number of scans, 1153 | detected threats, and other relevant statistics. This information is useful for monitoring the security status of the 1154 | virtual machine and assessing the effectiveness of the malware scanner. 1155 | */ 1156 | "undefined": { 1157 | params: { 1158 | /** 1159 | * Virtual Machine ID 1160 | */ 1161 | virtualMachineId: number; 1162 | }; 1163 | response: any; // Response structure will depend on the API 1164 | }; 1165 | 1166 | /** 1167 | * This endpoint installs the Monarx malware scanner on a specified virtual machine. 1168 | 1169 | [Monarx](https://www.monarx.com/) is a security tool designed to detect and prevent malware infections on virtual machines. 1170 | By installing Monarx, users can enhance the security of their virtual machines, ensuring that they are protected against malicious software. 1171 | */ 1172 | "undefined": { 1173 | params: { 1174 | /** 1175 | * Virtual Machine ID 1176 | */ 1177 | virtualMachineId: number; 1178 | }; 1179 | response: any; // Response structure will depend on the API 1180 | }; 1181 | 1182 | /** 1183 | * This endpoint uninstalls the Monarx malware scanner on a specified virtual machine. 1184 | If Monarx is not installed, the request will still be processed without any effect. 1185 | */ 1186 | "undefined": { 1187 | params: { 1188 | /** 1189 | * Virtual Machine ID 1190 | */ 1191 | virtualMachineId: number; 1192 | }; 1193 | response: any; // Response structure will depend on the API 1194 | }; 1195 | 1196 | /** 1197 | * This endpoint retrieves the historical metrics for a specified virtual machine. 1198 | It includes the following metrics: 1199 | - CPU usage 1200 | - Memory usage 1201 | - Disk usage 1202 | - Network usage 1203 | - Uptime 1204 | */ 1205 | "undefined": { 1206 | params: { 1207 | /** 1208 | * Virtual Machine ID 1209 | */ 1210 | virtualMachineId: number; 1211 | /** 1212 | * date_from parameter 1213 | */ 1214 | date_from: string; 1215 | /** 1216 | * date_to parameter 1217 | */ 1218 | date_to: string; 1219 | }; 1220 | response: any; // Response structure will depend on the API 1221 | }; 1222 | 1223 | /** 1224 | * This endpoint sets the nameservers for a specified virtual machine. 1225 | Be aware, that improper nameserver configuration can lead to the virtual machine being unable to resolve domain names. 1226 | */ 1227 | "undefined": { 1228 | params: { 1229 | /** 1230 | * Virtual Machine ID 1231 | */ 1232 | virtualMachineId: number; 1233 | /** 1234 | * ns1 parameter 1235 | */ 1236 | ns1: string; 1237 | /** 1238 | * ns2 parameter 1239 | */ 1240 | ns2?: string; 1241 | }; 1242 | response: any; // Response structure will depend on the API 1243 | }; 1244 | 1245 | /** 1246 | * This endpoint creates or updates a PTR (Pointer) record for a specified virtual machine. 1247 | */ 1248 | "undefined": { 1249 | params: { 1250 | /** 1251 | * Virtual Machine ID 1252 | */ 1253 | virtualMachineId: number; 1254 | }; 1255 | response: any; // Response structure will depend on the API 1256 | }; 1257 | 1258 | /** 1259 | * This endpoint deletes a PTR (Pointer) record for a specified virtual machine. 1260 | 1261 | Once deleted, reverse DNS lookups to the virtual machine's IP address will no longer return the previously configured hostname. 1262 | */ 1263 | "undefined": { 1264 | params: { 1265 | /** 1266 | * Virtual Machine ID 1267 | */ 1268 | virtualMachineId: number; 1269 | }; 1270 | response: any; // Response structure will depend on the API 1271 | }; 1272 | 1273 | /** 1274 | * This endpoint sets the panel password for a specified virtual machine. 1275 | If virtual machine does not use panel OS, the request will still be processed without any effect. 1276 | Requirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). 1277 | */ 1278 | "undefined": { 1279 | params: { 1280 | /** 1281 | * Virtual Machine ID 1282 | */ 1283 | virtualMachineId: number; 1284 | /** 1285 | * Panel password for the virtual machine 1286 | */ 1287 | password: string; 1288 | }; 1289 | response: any; // Response structure will depend on the API 1290 | }; 1291 | 1292 | /** 1293 | * This endpoint initiates the recovery mode for a specified virtual machine. 1294 | Recovery mode is a special state that allows users to perform system rescue operations, 1295 | such as repairing file systems, recovering data, or troubleshooting issues that prevent the virtual machine 1296 | from booting normally. 1297 | 1298 | Virtual machine will boot recovery disk image and original disk image will be mounted in `/mnt` directory. 1299 | */ 1300 | "undefined": { 1301 | params: { 1302 | /** 1303 | * Virtual Machine ID 1304 | */ 1305 | virtualMachineId: number; 1306 | /** 1307 | * Temporary root password for recovery mode 1308 | */ 1309 | root_password: string; 1310 | }; 1311 | response: any; // Response structure will depend on the API 1312 | }; 1313 | 1314 | /** 1315 | * This endpoint stops the recovery mode for a specified virtual machine. 1316 | If virtual machine is not in recovery mode, this operation will fail. 1317 | */ 1318 | "undefined": { 1319 | params: { 1320 | /** 1321 | * Virtual Machine ID 1322 | */ 1323 | virtualMachineId: number; 1324 | }; 1325 | response: any; // Response structure will depend on the API 1326 | }; 1327 | 1328 | /** 1329 | * This endpoint will recreate a virtual machine from scratch. 1330 | The recreation process involves reinstalling the operating system and resetting the virtual machine to its initial state. 1331 | Snapshots, if there are any, will be deleted. 1332 | 1333 | ## Password Requirements 1334 | Password will be checked against leaked password databases. 1335 | Requirements for the password are: 1336 | - At least 8 characters long 1337 | - At least one uppercase letter 1338 | - At least one lowercase letter 1339 | - At least one number 1340 | - Is not leaked publicly 1341 | 1342 | **This operation is irreversible and will result in the loss of all data stored on the virtual machine!** 1343 | */ 1344 | "undefined": { 1345 | params: { 1346 | /** 1347 | * Virtual Machine ID 1348 | */ 1349 | virtualMachineId: number; 1350 | /** 1351 | * Template ID 1352 | */ 1353 | template_id: number; 1354 | /** 1355 | * Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response. 1356 | */ 1357 | password?: string; 1358 | /** 1359 | * Post-install script ID 1360 | */ 1361 | post_install_script_id?: number; 1362 | }; 1363 | response: any; // Response structure will depend on the API 1364 | }; 1365 | 1366 | /** 1367 | * This endpoint restarts a specified virtual machine. This is equivalent to fully stopping and starting the virtual machine. 1368 | If the virtual machine was stopped, it will be started. 1369 | */ 1370 | "undefined": { 1371 | params: { 1372 | /** 1373 | * Virtual Machine ID 1374 | */ 1375 | virtualMachineId: number; 1376 | }; 1377 | response: any; // Response structure will depend on the API 1378 | }; 1379 | 1380 | /** 1381 | * This endpoint sets the root password for a specified virtual machine. 1382 | Requirements for the password is the same as in the [recreate virtual machine endpoint](/#tag/vps-virtual-machine/POST/api/vps/v1/virtual-machines/{virtualMachineId}/recreate). 1383 | */ 1384 | "undefined": { 1385 | params: { 1386 | /** 1387 | * Virtual Machine ID 1388 | */ 1389 | virtualMachineId: number; 1390 | /** 1391 | * Root password for the virtual machine 1392 | */ 1393 | password: string; 1394 | }; 1395 | response: any; // Response structure will depend on the API 1396 | }; 1397 | 1398 | /** 1399 | * This endpoint will setup newly purchased virtual machine with `initial` state. 1400 | */ 1401 | "undefined": { 1402 | params: { 1403 | /** 1404 | * Virtual Machine ID 1405 | */ 1406 | virtualMachineId: number; 1407 | /** 1408 | * Template ID 1409 | */ 1410 | template_id: number; 1411 | /** 1412 | * Data center ID 1413 | */ 1414 | data_center_id: number; 1415 | /** 1416 | * Post-install script ID 1417 | */ 1418 | post_install_script_id?: number; 1419 | /** 1420 | * Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response. 1421 | */ 1422 | password?: string; 1423 | /** 1424 | * Override default hostname of the virtual machine 1425 | */ 1426 | hostname?: string; 1427 | /** 1428 | * Install Monarx malware scanner (if supported) 1429 | */ 1430 | install_monarx?: boolean; 1431 | /** 1432 | * Enable weekly backup schedule 1433 | */ 1434 | enable_backups?: boolean; 1435 | /** 1436 | * Name server 1 1437 | */ 1438 | ns1?: string; 1439 | /** 1440 | * Name server 2 1441 | */ 1442 | ns2?: string; 1443 | /** 1444 | * Use SSH key 1445 | */ 1446 | public_key?: object; 1447 | }; 1448 | response: any; // Response structure will depend on the API 1449 | }; 1450 | 1451 | /** 1452 | * This endpoint retrieves a snapshot for a specified virtual machine. 1453 | */ 1454 | "undefined": { 1455 | params: { 1456 | /** 1457 | * Virtual Machine ID 1458 | */ 1459 | virtualMachineId: number; 1460 | }; 1461 | response: any; // Response structure will depend on the API 1462 | }; 1463 | 1464 | /** 1465 | * This endpoint creates a snapshot of a specified virtual machine. 1466 | A snapshot captures the state and data of the virtual machine at a specific point in time, 1467 | allowing users to restore the virtual machine to that state if needed. 1468 | This operation is useful for backup purposes, system recovery, 1469 | and testing changes without affecting the current state of the virtual machine. 1470 | 1471 | **Creating new snapshot will overwrite the existing snapshot!** 1472 | */ 1473 | "undefined": { 1474 | params: { 1475 | /** 1476 | * Virtual Machine ID 1477 | */ 1478 | virtualMachineId: number; 1479 | }; 1480 | response: any; // Response structure will depend on the API 1481 | }; 1482 | 1483 | /** 1484 | * This endpoint deletes a snapshot of a specified virtual machine. 1485 | */ 1486 | "undefined": { 1487 | params: { 1488 | /** 1489 | * Virtual Machine ID 1490 | */ 1491 | virtualMachineId: number; 1492 | }; 1493 | response: any; // Response structure will depend on the API 1494 | }; 1495 | 1496 | /** 1497 | * This endpoint restores a specified virtual machine to a previous state using a snapshot. 1498 | Restoring from a snapshot allows users to revert the virtual machine to that state, which is useful for system recovery, undoing changes, or testing. 1499 | */ 1500 | "undefined": { 1501 | params: { 1502 | /** 1503 | * Virtual Machine ID 1504 | */ 1505 | virtualMachineId: number; 1506 | }; 1507 | response: any; // Response structure will depend on the API 1508 | }; 1509 | 1510 | /** 1511 | * This endpoint starts a specified virtual machine. 1512 | If the virtual machine is already running, the request will still be processed without any effect. 1513 | */ 1514 | "undefined": { 1515 | params: { 1516 | /** 1517 | * Virtual Machine ID 1518 | */ 1519 | virtualMachineId: number; 1520 | }; 1521 | response: any; // Response structure will depend on the API 1522 | }; 1523 | 1524 | /** 1525 | * This endpoint stops a specified virtual machine. 1526 | If the virtual machine is already stopped, the request will still be processed without any effect. 1527 | */ 1528 | "undefined": { 1529 | params: { 1530 | /** 1531 | * Virtual Machine ID 1532 | */ 1533 | virtualMachineId: number; 1534 | }; 1535 | response: any; // Response structure will depend on the API 1536 | }; 1537 | } 1538 | --------------------------------------------------------------------------------