Skip to content

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:
curl -s "https://invapi.hostkey.com/tags.php" -X POST \
  --data "action=list" \
  --data "token=$HOSTKEY_TOKEN" \
  --data "id=SERVER_ID"

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:

export HOSTKEY_TOKEN="your_api_token_here"

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.

api_keys.php

API key management module: creation, editing, deletion, history viewing, and retrieving key lists for customers and servers.

Method Description
add Creates a new API key for a customer or a specific server. Requires the customer to have active servers.
delete Removes 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, WHMCS login, API keys, SSO (Google, GitHub, VK), two-factor authentication, and token verification.

Method Description
info Returns information about the current token, including role, permissions, server list, verification status, and billing settings.
login User authorization via API key. Returns a session token, list of available servers, and permissions.
logout Clears the specified access token, terminating the user session.
whmcslogin Authorization via WHMCS credentials (email/password) or SSO. Supports billing selection and two-factor authentication.

eq.php

Equipment management module (eq.php) for server operations: ordering, deployment, rebooting, power management, IPMI, backups, and monitoring.

Method Description
add_ipmi_user Adds an IPMI user for the specified server. Generates a random login and password if not provided by the administrator.
boot_dev Boots the server from the specified media (PXE or disk).
clear_pxe Clears the PXE configuration for the specified server, allowing the deployment process to be restarted.
create_pxe Requests a server reinstall via PXE.
list Returns a list of available equipment based on various search criteria.
novnc Initializes a connection to the NoVNC console for the specified server. Returns a key to track the operation status.
off Requests to power off the server.
on Sends a command to power on the server by the specified ID. Requires token validation and access rights check.
order_instance Orders a new server or reinstalls an existing one.
reboot Requests to reboot the server.
recreate_novnc Recreates the NoVNC console for the callback mechanism.
reinstall Requests a server reinstall (reinstall) via the order_instance method.
remove_ipmi_user Removes additional IPMI users.
sensors Requests current sensor readings (temperature, voltage, RPM) for the specified server.
show Returns data about the server and equipment.
status Retrieves the server status by ID.
stop_novnc Terminates the NoVNC console session for the specified server.
unit_reset Requests an IPMI reset for the server.
update_servers Updates the list of active servers for the current token by checking statuses in billing and adding new servers to the session.

eq_callback.php

Module for processing asynchronous callbacks from worker tasks for managing hardware, servers, and virtual machines. Handles task execution statuses (deploy, reinstall, backup, network operations) and

Method Description
check Checks the current status of an asynchronous task by key and returns the execution result, context, and debug information.

ip.php

Module for managing IP addresses and network infrastructure: retrieving IP information, managing PTR records, tracking traffic, and working with subnets and VLANs.

Method Description
get_client_ip Returns the current client's IP address
get_ip Returns full information about a specific IP address (network, mask, etc.)
get_ptr Checks and returns the PTR record for the specified IP
get_traffic Returns incoming and outgoing traffic statistics for an IP over a specified period
list_free_ip Returns a list of available IP addresses for a specified location or subnet
set_main Sets the specified IP as the primary IP for the server interface
update_ptr Updates the PTR record (reverse DNS) for the specified IP

iso.php

Method Description
add Adds a new ISO image or updates an existing one by name. Requires administrator privileges.
del Deletes an ISO image. Available to administrators and owners of private images.
delete Alternative method to delete an ISO image by ID.
history Returns the history of operations with ISO images.
list_iso Returns a list of available ISO images. Server ID is required for clients.
mount_iso Mounts an ISO image to the specified server. Returns a task key for tracking.
unmount_iso Unmounts an ISO image from the specified server. Returns a task key.
update Updates metadata of an existing ISO image.
upload Uploads an ISO image via URL. Requires email and customer_id for staff members.
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 related to server management (power, reboot, KVM) and sales assistance requests.

Method Description
request_PXEboot Creates a Jira ticket for manual server PXE boot if remote management is unavailable.
request_assistance Creates a Jira ticket for the sales department with details regarding service cancellation or modification.
request_check Creates a Jira ticket to check and boot the server into the OS if remote management is unavailable.
request_kvm Creates a Jira ticket to connect an IP KVM to the server.
request_poff Creates a Jira ticket for manual server power off.
request_pon Creates a Jira ticket for manual server power on.
request_reboot Creates a Jira ticket for manual server reboot.

nat.php

Module for managing static NAT: adding and removing IP address forwarding rules via MikroTik.

Method Description
add_static_nat Adds a static NAT passthrough for the specified server. Accepts the server ID and ACL for IPMI.
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 graphs.

Method Description
add_ipv4 Adds a specified number of IPv4 addresses to a server on a specific port and VLAN. Supports selecting specific IPs or automatic selection of free ones.
block_ip Blocks a specified IP address on the server via BIRD or blackhole. Requires a reason for the block.
get_status Returns the current status of the server's network interface (up/down, speed, duplex, MAC).
port_off Disables the server's network interface. Can add a block tag with a reason.
port_on Enables the server's network interface. Removes the block tag if it was not set by an administrator.
remove_ipv4 Removes a specified IPv4 address or all addresses from the server. Clears PTR records in DNS.
show_cacti Returns data or a link to a traffic graph for the specified server port from the Cacti monitoring system.
show_ipv4_free Returns a list of available free IPv4 addresses for the specified server, port, and VLAN.
unblock_ip Unblocks a previously blocked IP address on the server. Requires administrator privileges or matching the block reason.

os.php

Operating Systems Management Module: provides methods for adding, removing, updating, and retrieving a list of operating systems with filtering by hardware compatibility and licenses.

Method Description
list Returns a list of available operating systems filtered by hardware type (VM, BM, GPU), licenses, and location. Supports filtering for a specific server or preset.

pdns.php

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

Method Description
groups Returns a list of preset groups
info Returns a list of presets for resellers with prices in specified currencies
list Returns a list of available presets with filtering by location and access rights
search Searches for suitable servers for a specific preset by name
show Returns detailed information about a preset by ID or name

rhr.php

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

Method Description
create_account Creates a free S3 account and bucket for the user.
create_bucket Creates a new bucket in an existing S3 account.
create_order Creates an order for a paid S3 account, initiates billing, and creates the user.
delete_account Completely deletes the user's S3 account.
delete_bucket Deletes the specified bucket from the S3 account.
delete_file Deletes the specified file from the bucket.
get_buckets Returns a list of buckets and traffic information via the AWS API.
get_buckets_rmq Returns a list of buckets with detailed usage information and access keys via the message queue.
get_files Returns a list of files and folders in the specified bucket with pagination and search support.
get_users Returns a list of S3 accounts with traffic and storage usage information.
history Returns the change history for the specified pricing plan.
list_plans Returns a list of available S3 pricing plans.
show_key Returns the decrypted access key (access_key or secret_key) for the S3 account.

software.php

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 promotional offers.

stocks.php

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

Method Description
add Adds a custom tag to a server or component. Supports adding to a list of IDs via id_list.
list Returns a list of all tags for the specified server or component.
remove Removes a tag by name from the specified server or component. Supports removal by ID list.

traffic_plans.php

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/RUB.

vm.php

Method Description
create_snapshot Initiates the creation of a snapshot for the specified virtual machine.
get_snapshot Requests the list of existing snapshots for a virtual machine.
load_stats Requests the current resource usage statistics for a virtual machine.
remove_snapshot Initiates the deletion of the specified snapshot.
restore_snapshot Initiates the restoration of the virtual machine state from a snapshot.

whmcs.php

WHMCS integration module for managing clients, invoices, credits, order cancellations, and server billing data.

Method Description
add_contact Adds a new contact to an existing client in the billing system.
apply_credit Applies credit from the client's balance to pay a specified invoice.
create_addfunds Creates an invoice for adding funds (Add Funds).
delete_cancellation_request Removes an active server cancellation request and restores the invoice.
delete_contact Removes a contact from the client account.
download_invoice Generates and returns the invoice PDF file.
generate_due_invoice Generates the next invoice for server payment.
get_billing_data Retrieves synchronized billing data for a server.
get_cancellation_requests Returns a list of active server cancellation requests.
get_client Returns information about the authorized client or by ID.
get_clientgroups Returns a list of client groups in the billing system.
get_contacts Returns a list of additional client contacts.
get_invoice Returns data for a specific invoice.
get_invoices Returns a list of client invoices.
get_related_invoices Returns invoices linked to a server or account.
getcredits Returns the client's credit history.
getpaymentgw Returns available payment methods for an invoice.
mass_pay Pays multiple invoices with a single payment.
request_cancellation Initiates the server cancellation process with refund calculation.
reset_password Initiates a password reset or sets a new one with 2FA.
transactions Returns the client's transaction history.
update_client Updates the client profile data in the billing system.
update_contact Updates the client contact data.
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×