InvAPI Control Panel API Documentation¶
This documentation describes the overall design and principles of the API, along with specific endpoints and usage examples.
Overview
The invapi.hostkey.com control panel is built on top of this API.
Making API Requests¶
All API requests must be made over HTTPS to ensure encryption of data in transit.
Use the POST method for all requests unless otherwise specified.
API Example Format¶
Examples in this documentation use curl, a command-line HTTP client. curl is pre-installed on most Linux and macOS systems and is available for download on all major platforms, including Windows.
Each example is split across multiple lines using the \ line continuation character, which is compatible with bash. A typical request looks like this:
Example POST Request:
The -X flag specifies the HTTP method. For consistency, the method is included in all examples, even when not explicitly required for GET requests.
Examples that require a JSON payload in the request body pass the data via the --data parameter.
All API responses are returned in JSON format and formatted in this documentation for readability.
Tip: Environment Variables
To avoid repeating your API token in every example, you can export it once as an environment variable in your terminal. On Linux or macOS:
The token will then be automatically substituted in your requests.
Disclaimer
All values shown in this documentation are for illustrative purposes only. Do not rely on operating system IDs, plan identifiers, or other example values. Always use your actual server, network, or domain identifiers when querying or creating resources. In some cases, only the account API key will work, not the specific server key (and vice versa), so if you encounter method authorization errors, try switching the API key type.
api_keys.php¶
API key management module: creation, editing, deletion, viewing history, and retrieving lists of keys for customers and servers.
| Method | Description |
|---|---|
add | Creates a new API key for a customer or a specific server. The customer must have active servers. |
delete | Deletes the specified API key from the system. |
edit | Modifies parameters of an existing API key (name, IP, status, expiration). |
history | Returns the history of actions performed on API keys (creation, modification, deletion). |
list | Returns a list of all API keys for the current customer. |
list_for_server | Returns a list of API keys bound to a specific server. |
view | Returns detailed information about a single API key. |
auth.php¶
Authentication and authorization module: session management, login via WHMCS, LDAP, API keys and SSO (Google, GitHub, VK), 2FA verification, SMS and email, as well as customer tag management.
| Method | Description |
|---|---|
2fa_check | Verifies the entered two-factor authentication code for the current user session. |
2fa_resend | Sends a new two-factor authentication code to the linked channel (Email or SMS) for the current session. |
billing_list | Returns a list of available payment systems (billings) linked to the current session or available to the administrator. |
email_check | Validates the email, registers the customer in the system (if not found), and sends a verification code to the email address. |
flip_tag | Creates or removes the specified tag for the customer. If the tag already exists, it will be removed; if it does not exist, it will be added. |
get_log | Returns the authorization event log for a specified period or by token. |
get_log_details | Returns detailed information about authentication events linked to a user token. |
github_init | Initiates the GitHub authorization process, generates a unique state, and returns the data required to redirect the user to the GitHub OAuth page. |
github_signin | Initiates the GitHub OAuth authorization process. Generates a temporary state and token for subsequent code-to-session exchange. |
google_signin | Logs in using a Google ID Token. If the token is valid, it links the account to the user or updates the existing session. |
info | Returns detailed information about the current user session, including role, permissions, customer data, and active servers. |
login | Authenticates a user via the provided API key, checking IP restrictions and linked servers. Returns a session token and a list of available servers. |
logout | Clears the current active access token of the user. |
session_reset | Terminates all active user sessions based on their email and reset token. Performs cleanup of tags (sessions) in the database. |
set_tag | Creates or removes a tag for the customer. Allows setting values for various metadata (e.g., auto_credit). |
tg_verify | Links the user's Telegram username to their account (removing the old ID) and returns a link to the bot. |
vk_init | Initiates the VK authorization process, generating parameters for the client side (code_challenge, state, and device_id). |
vk_signin | Initiates the authorization process through the VK social network, generating temporary data for OAuth2 (state, code_verifier) and saving it in the system. |
whmcslogin | Logs into the system. Supports standard authentication (email/password) and SSO methods (Google, GitHub, VK). Upon successful login, returns a session token, user data, and permissions. |
eq.php¶
Equipment Management Module (eq.php): API for server deployment, power management, IPMI, backups, and searching/retrieving detailed hardware configuration information.
| Method | Description |
|---|---|
abort_reinstall | Interrupts the server reinstallation process, removes associated tags (reinstall_start, autodeploy_start, autodeploy_timeout) and restores VLAN settings. |
add_ipmi_admin | Adds a user with administrator privileges to the IPMI interface for a specific server. If the user already exists, returns their data. |
add_ipmi_user | Creates a new IPMI user for the server. If the user is an administrator, the provided credentials are used. |
announceip | Performs announcement of the specified subnet for a server with a specific ASN. |
backup_get_schedule | Returns the current automatic backup schedule for the specified server. |
backup_list | Returns a list of available backups for the specified equipment (server). |
backup_save_schedule | Saves the configured backup schedule for the specified server. |
boot_dev | Requests booting the server from a specified media type (PXE or disk) in UEFI or Legacy mode. |
check_backup_lock | Checks for an active lock to perform operations with server backups. |
check_pin | Checks the PIN code for operations. |
clear_pxe | Clears the current PXE configuration for the specified host. |
console | Requests access to the server management console via IPMI/NoVNC. |
create_backup | Initiates the backup creation process for the specified server. The operation is executed asynchronously via a queue. |
create_pxe | Creates a Preboot Execution Environment (PXE) configuration to install a selected OS on the server. Supports configuring hostname, SSH keys, and post-install scripts. |
delete_backup | Deletes the specified server backup. The backup name is required. |
deploy | Initiates the deployment process of a new server by ID or preset. Supports OS selection, hostname configuration, SSH keys, and disk parameters. |
get_ipmi | Returns the IP address and IPMI interface model for the specified server. May contain multiple interfaces. |
get_traffic | Returns IPv4 traffic data for the specified server. |
get_upgrade_key | Returns the upgrade key linked to a specific invoice (invoice_id). |
getserversforannounce | Returns a list of available servers (rent or power_off) that match IP subnet and mask constraints to perform the announcement procedure. |
groups | Returns a list of groups for the specified server. |
hard_off | Performs a forced shutdown of theserver (Hard Off). If the server is in OpenStack, a forced reboot is performed. |
history | Returns the server event history. |
list | Returns a list of available servers and equipment with support for advanced search by various parameters (location, status, type, IP, MAC, etc.). |
off | Turns off the server. |
on | Turns on the server. |
order_instance | Starts the process of ordering a new server by preset or performs a reinstallation (reinstall) of an existing server with OS and additional software selection. |
ovirt_novnc | Requests access to the oVirt console via noVNC protocol for the specified server. |
reboot | Sends a request to reboot the hardware. If the server is in standby mode, execution via IPMI may be required. |
reinstall | Creates a key to start the server reinstallation process and adds the task to the queue. |
remove_ipmi_user | Deletes additional IPMI user accounts for the specified server. |
request_backup_link | Requests a temporary link to download a server backup. |
restore_backup | Initiates the server restoration process from the specified backup. The method is asynchronous and returns a callback to track task execution. |
search | Returns a list of available or active equipment based on various filters (group, location, status, IP, MAC, etc.). |
sensors | Returns sensor status data for the specified server. |
set_pin | Sets a PIN code for operations. |
show | Returns detailed information about the server, including hardware (hwconfig), operating system, IP addresses, interfaces, and IPMI. |
status | Returns the current server status, state data, and available management parameters. |
status_check | Returns the current equipment status (availability/status check). |
suspend | Requests suspension (suspend) or unsuspension (unsuspend) of a VPS/server. Operation requires access rights and, in some cases, administrator lock checks. |
traffic_add | Increases the outbound traffic limit for the server and creates a corresponding invoice in WHMCS. |
unified_server_search | Unified server search by query. |
unit_reset | Request to reset the device via IPMI interface for the specified server. |
unsuspend | Unsuspends a server if it was temporarily suspended. |
update_servers | Updates the list of active and pending payment servers for the current user, synchronizing them with WHMCS data. |
eq_callback.php¶
Module for processing asynchronous responses from workers to manage hardware (EQ) and virtual machines. It processes task statuses (deploy, reinstall, backup, network), updates billing, and sends noti
| Method | Description |
|---|---|
check | Checks the execution status of an asynchronous job by key. Returns current state, context, and debug information. |
reinstall | Starts the operating system reinstallation process on the server. If the deploy_options=reinstall parameter is specified in the request, a full cleanup of tags and configuration is performed upon completion. |
ip.php¶
IP address and network infrastructure management module: retrieving IP information, managing PTR records, traffic monitoring, working with subnets and VLANs.
| Method | Description |
|---|---|
get_client_ip | Returns the current IP address of the client making the request to the API. |
get_ip | Returns full network configuration information for a specific IP address (mask, network, etc.) |
get_ptr | Checks if the IP address belongs to the server and returns the current PTR record for this IP in the specified location. |
get_traffic | Returns inbound and outbound traffic data for a specified IP address over a selected period. Can return both summary information and detailed timestamps. |
list_free_ip | Returns a list of unused IPv4 addresses for the specified location based on Route Reflector tags. For clients, it is only available within their own subnets. |
set_main | Sets the specified IP address as the primary one for the server's network interface. |
update_ptr | Updates the reverse DNS record (PTR) for a specified IP address within a specific location. Requires server access permission verification. |
iso.php¶
ISO Image Management Module: uploading, deleting, mounting, and unmounting images on servers, as well as retrieving lists of available and uploaded images.
| Method | Description |
|---|---|
add | Adds a new ISO image or updates an existing one by name. |
delete | Deletes an ISO image by ID. |
list_iso | Returns a list of available ISO images. |
mount_iso | Mounts an ISO image on the specified server. |
unmount_iso | Unmounts an ISO image from the specified server. |
upload | Uploads an ISO image via URL. |
uploaded | Returns a list of uploaded ISO images for a client or staff member. |
jenkins.php¶
Jenkins integration module for task management: retrieving the list of available tasks and executing them for servers.
| Method | Description |
|---|---|
get_tasks | Returns the list of available Jenkins tasks accessible to the current user or client. |
jira.php¶
Jira integration module for creating support tickets for server management (power, reboot, KVM) and sales assistance requests.
| Method | Description |
|---|---|
request_PXEboot | Creates a Jira ticket for manual PXE booting of the server if remote control is unavailable. |
request_assistance | Sends a request for technical or commercial assistance by creating a Jira ticket, checking for duplicates, and collecting server and billing data. |
request_check | Creates a Jira ticket to check the server and boot it into the OS if remote control is unavailable. |
request_kvm | Creates a Jira ticket to connect IP KVM to the server. |
request_poff | Creates a Jira ticket for manual power off of the server. |
request_pon | Creates a Jira ticket for manual power on of the server. |
request_reboot | Creates a Jira ticket for manual reboot of the server. |
nat.php¶
Static NAT management module: adding and removing IP address forwarding rules via MikroTik.
| Method | Description |
|---|---|
add_static_nat | Creates a static NAT passthrough via Microtic for the specified server with ACL and TTL support. |
remove_static_nat | Removes the static NAT passthrough for the specified server or white IP. |
net.php¶
Network infrastructure management module: adding and removing IP addresses, blocking traffic, managing network port states, retrieving statistics, and displaying Cacti charts.
| Method | Description |
|---|---|
add_ipv4 | Adds the specified number of IPv4 addresses to a server in a given port and VLAN. If no IP is specified, the system selects free addresses available in this location. |
block_ip | Blocks the specified IP address via BIRD or blackhole. If the description parameter is not provided, the system prefix of the owner is used. |
get_status | Returns network interface status information (port status, speed, duplex, etc.) for the specified server. |
port_off | Disables the server's network port. If a reason (block_reason) is provided, an administrative block tag is created. |
port_on | Activates the server's network port, removing associated blocking tags (e.g., 'block'), if permitted by security policy. |
remove_ipv4 | Removes one or all IPv4 addresses from the server. If the remove_all parameter is specified, all assigned addresses are removed. |
show_cacti | Returns data for displaying Cacti charts associated with the server's network interface. |
show_ipv4_free | Returns a list of available IPv4 addresses for assignment in the specified VLAN, taking into account tags (tag) for a specific server. |
unblock_ip | Removes the block from the specified IP address on the server via BIRD or other network management mechanisms. |
os.php¶
Operating system management module: provides methods for adding, removing, updating, and retrieving a list of OS with filtering by hardware compatibility and licenses.
| Method | Description |
|---|---|
list | Returns a list of operating systems. If id or instance_id is specified, filters OS by compatibility with hardware or preset. Also returns a list of excluded OS. |
pdns.php¶
DNS record and zone management module: adding, deleting, and viewing domains, subdomains, and zones, as well as retrieving callback-URL information.
| Method | Description |
|---|---|
add_dns | Adds a new DNS record to the specified zone. |
add_domain | Adds a new domain to the DNS system for the specified client. |
delete_dns | Deletes the specified DNS record. |
delete_domain | Deletes the domain and all associated records. |
get_cb_url | Returns the URL for callback notifications. |
list_domains | Returns the list of client domains. |
list_zones | Returns the list of DNS zones. |
view_zone | Returns details of the specified DNS zone. |
presets.php¶
Server preset management module: retrieving lists, grouping, searching for suitable servers, and detailed configuration information with prices in different currencies.
| Method | Description |
|---|---|
groups | Returns a list of available preset groups |
info | Returns a list of available currencies for displaying preset prices. By default, it returns EUR and USD. |
list | Returns a list of available presets considering the user's location and access rights |
search | Returns a list of suitable servers for a specific preset by its name, scope, and location |
show | Returns detailed information about a specific preset by its ID or name, taking into account restrictions for certain regions and payment parameters. |
rhr.php¶
Remote Hands Requests Management Module: creation, filtering, status updates, and communication regarding requests.
| Method | Description |
|---|---|
add | Creates a new Remote Hands Request (RHR) specifying the type and equipment. |
chat | Adds a client-visible message to the request history. |
discard | Recursively changes the request status to canceled or closed. |
list | Returns a list of available RHR tasks with filtering by location, status, and date. |
s3.php¶
S3 storage management module: creating and deleting accounts, managing buckets and files, obtaining usage statistics, managing pricing plans and billing.
| Method | Description |
|---|---|
cancel_payment_account_deletion | Cancels the S3 account deletion process initiated via a deletion request. Restores the service status. |
create_account | Creates a new S3 account based on the selected pricing plan, checks free account limits and user credits, and creates an order in the billing system. |
create_bucket | Creates a new S3 bucket for an existing user account. Requires an active s3uid belonging to the client. |
create_order | Creates a new S3 account (bucket) for the user, links it to a pricing plan, and places an order in the billing system. |
delete_account | Deletes the user's S3 account, cancels associated services, and performs action auditing. |
delete_bucket | Deletes the specified S3 bucket after verifying its ownership by the user and its presence in the list of available buckets. |
delete_file | Deletes the specified file from the S3 bucket. Requires a valid s3uid of the account owner. |
delete_payment_account | Requests subscription cancellation and S3 account deletion. If successful, the service is moved to cancellation status. |
get_buckets | Returns a list of S3 buckets, traffic information, and snapshots for the specified account. |
get_buckets_rmq | Returns the user's bucket list, storage usage information, billing data, and S3 access credentials. |
get_files | Returns a list of files and folders in the specified S3 bucket with pagination support via continuation token. |
get_users | Returns a list of S3 accounts with detailed information on plans, traffic, and storage usage. Supports filtering by plan_id, email, s3uid, billing, and location. |
history | Returns the action history associated with a specific ID (likely an account or user). |
list_plans | Returns a list of available S3 plans including VAT rate and user currency. For administrators, it can return a specific plan by ID. |
show_key | Returns the decrypted secret key or public access key for the specified account. |
software.php¶
Software management module: provides methods to get a list of available software filtered by server characteristics or preset, as well as selecting compatible presets and operating systems for specifi
| Method | Description |
|---|---|
list | Returns a list of software suitable for a specific server (id) or preset (instance_id), taking into account licenses, hardware specifications, and promotions. |
stocks.php¶
Server inventory management module: provides lists of available servers with filtering by locations and groups, as well as detailed information about a specific server.
| Method | Description |
|---|---|
list | Returns a list of available servers in inventory with the ability to filter by location and group. |
show | Returns detailed information about a specific server by its identifier. |
tags.php¶
Tag management module for infrastructure components: adding, removing, clearing, searching, and displaying tag lists for servers and variables.
| Method | Description |
|---|---|
add | Adds a custom tag to a server or component. Supports bulk addition via an ID list. |
clear | Clears all or non-essential tags from a component. For clients, only public tags are available. |
get | Retrieves tags for a component. (Implementation is empty in code, method is in whitelist) |
list | Returns a list of tags for a specific server or component. For clients, there is a restriction by component type (eq, vars). |
remove | Removes a tag by its name for a specific component or removes all specified tags from an ID list. If id_list is passed, the operation is performed in bulk. |
search | Searches for components matching a specific tag and value. |
search_user | Searches for user equipment by tag value. Used in global search form. |
show | Shows possible tags for a component. (Implementation is empty in code, method is in whitelist) |
traffic_plans.php¶
Traffic tariff plan management module: creation, deletion, updating, and retrieval of available plans with filtering by server or location and price conversion.
| Method | Description |
|---|---|
list | Returns a list of suitable traffic tariff plans for the specified server (id) or location. Supports filtering by hardware type and price conversion to EUR/USD. |
vm.php¶
Virtual Machine (VM) management module providing an API for creating, retrieving, deleting, and restoring snapshots, as well as loading statistics.
| Method | Description |
|---|---|
create_snapshot | Initiates the creation of a snapshot for the specified virtual machine. Returns a task key for status tracking. |
get_snapshot | Returns a list of snapshots and settings for the specified virtual machine. |
load_stats | Initiates the loading of resource usage statistics for the virtual machine. |
remove_snapshot | Initiates the deletion of a snapshot with the specified name. |
restore_snapshot | Initiates the restoration of the virtual machine state from a snapshot. |
update_restore_settings | Updates automatic restore and snapshot rotation settings for the specified virtual machine. |
whmcs.php¶
WHMCS integration module for managing customers, invoices, credit, order cancellations, and server billing data.
| Method | Description |
|---|---|
add_contact | Adds a new additional contact for a customer or creates a random contact user. |
apply_credit | Applies the customer's available balance (credit) to pay a selected invoice. If the invoice status changes to 'Paid' after payment, associated traffic overage tags are automatically cleared. |
create_addfunds | Creates an invoice in WHMCS for topping up the customer's balance (Add Funds). Supports creating a regular invoice or an invoice with automatic subscription inclusion. |
delete_cancellation_request | Deletes an active service cancellation request for a specific server, allowing the order status to be restored or a new invoice to be generated. |
delete_contact | Deletes an additional contact linked to a customer in WHMCS. |
download_invoice | Returns the invoice PDF file in base64 format. Allows viewing the invoice (inline) or downloading it as a file (attachment). |
generate_due_invoice | Generates the next invoice for a server in WHMCS, taking into account the current billing cycle and active add-ons. |
get_billing_data | Returns detailed billing information for a specific server, including customer data, EU B2C status, and refund information (if applicable). |
get_cancellation_requests | Returns a list of active service cancellation requests for a specific server or user, with filtering by date, type, and payment status. |
get_client | Returns detailed customer information from WHMCS, including profile data, groups, and internal system data. |
get_clientgroups | Returns a list of available customer groups from WHMCS for the specified location. |
get_contacts | Returns a list of additional contacts for the specified customer or checks access rights to them. |
get_invoice | Returns detailed information about an invoice from WHMCS, including customer data and payment status. |
get_invoices | Returns a list of all invoices associated with a user's account in WHMCS for the specified location. |
get_related_invoices | Returns a list of invoices associated with a specific server or account in WHMCS. |
getcredits | Returns information about available credits in the WHMCS account balance. |
getpaymentgw | Returns a list of available payment methods for a specific invoice with processed payment links. |
mass_pay | Allows bulk payment of several invoices simultaneously for a customer. A minimum of 2 invoices is required. |
request_cancellation | Initiates the process of canceling an order or service in WHMCS. Checks for active licenses, invoice payment status, and automatic refund eligibility (including EU B2C rules). May account for write-offs if there are traffic debts. |
request_subscription_cancellation | Creates a JIRA ticket to cancel the bank subscription for a server. Checks for active subscriptions and payment status. |
reset_password | Initiates the password reset process. If no token is provided, an email link is sent. If the token is valid, it allows setting a new password or requesting a 2FA code. |
transactions | Returns a list of financial transactions for the user from WHMCS. If no data is found, returns an empty array. |
update_client | Updates the customer profile in WHMCS, including personal data (name, email), contact information, and custom fields. Supports updating legal data for companies. |
update_contact | Updates contact person data (first name, last name, email, phone) in the WHMCS system. If the email is updated, re-verification may be required. |