Hostinger API icon

Hostinger API

Interact with the Hostinger API

Overview

This node provides integration with the Hostinger API, enabling users to manage various Hostinger services programmatically within n8n workflows. It supports multiple categories such as VPS (Virtual Private Servers), DNS management, Domains, Billing, and Reach (contact management). Users can perform a wide range of operations like managing virtual machines, backups, firewalls, domain availability checks, billing subscriptions, and contact lists.

Typical use cases include automating server provisioning and management, updating DNS zones, purchasing or managing domains, handling billing tasks, and managing contacts for marketing or customer relations. For example, a user could automate the creation of a new VPS instance, configure its firewall rules, and then update DNS records accordingly, all within a single workflow.

Properties

Name Meaning
Category The main service category to interact with. Options: Billing, DNS, Domains, Reach, VPS.
Subcategory Further subdivision within the selected category. For VPS, options include Actions, Backups, Data Centers, Firewall, Malware Scanner, OS Templates, Post-Install Scripts, PTR Records, Public Keys, Recovery, Snapshots, Virtual Machine. For Domains, subcategories include Availability, Portfolio, WHOIS, Forwarding.
VPS Action Specific action to perform under the VPS category and chosen subcategory. Examples: Get Action, List Actions, Delete Backup, List Backups, Create PTR, Activate Firewall, Get Monarx, Get Template, Create Post Install Script, Attach Public Key, Create Recovery, Get Snapshot, Get VM Metrics, Purchase New Virtual Machine, Restart VM, etc.
DNS Action Specific action to perform under the DNS category. Examples: DNS Snapshot Get, List DNS Snapshots, Restore DNS Snapshot, DNS Zone Delete, Update, Reset, Validate.
Domains Action Specific action to perform under the Domains category and chosen domain subcategory. Examples: Check Domain Availability, Get Domain, List Domains, Purchase Domain, Enable/Disable Domain Lock, Manage WHOIS Profiles, Manage Forwarding Data.
Billing Action Specific action to perform under the Billing category. Examples: Cancel Subscription, Delete Payment Method, Get Catalog Item List, Get Payment Method List, Set Default Payment Method.
Reach Action Specific action to perform under the Reach category. Examples: List Contacts, Create Contact, Delete Contact, List Contact Groups.
Virtual Machine ID Identifier for the virtual machine, required for many VPS actions.
Date From Start date for metrics queries (VPS metrics).
Date To End date for metrics queries (VPS metrics).
Action ID Identifier for a specific action on a VPS.
Backup ID Identifier for a backup in VPS.
Firewall ID Identifier for a firewall in VPS.
Snapshot ID Identifier for a DNS snapshot.
Domain Domain name string, used in DNS and Domains categories for various actions.
WHOIS ID Identifier for a WHOIS profile.
Rule ID Identifier for a firewall rule.
Post Install Script ID Identifier for a post-install script in VPS.
Public Key ID Identifier for a public key in VPS.
Template ID Identifier for an OS template in VPS.
Payment Method ID Identifier for a payment method in Billing.
Subscription ID Identifier for a subscription in Billing.
Request Body Raw JSON body for POST/PUT requests, allowing custom data to be sent with the request. Used in many actions that require detailed input parameters.
Email Email address for creating a contact in Reach.
Name First name of the contact (Reach).
Surname Last name of the contact (Reach).
Group UUIDs Comma-separated list of group UUIDs to assign the contact to (Reach).
Note Note about the contact (max 75 characters) (Reach).
Contact UUID UUID of the contact to delete (Reach).
Group UUID Filter contacts by group UUID (Reach).
Subscription Status Filter contacts by subscription status: All, Subscribed, Unsubscribed (Reach).
Page Page number for pagination when listing contacts (Reach).

Output

The node outputs an array of JSON objects, each containing a response field with the data returned from the Hostinger API for the executed action. If an error occurs during the API call, the output contains an error field with the error message and a request field showing the details of the HTTP request made.

The structure of the response depends on the specific API endpoint called and the action performed. It typically includes details relevant to the requested resource, such as virtual machine information, domain status, billing details, or contact data.

The node does not explicitly handle binary data output.

Dependencies

  • Requires an API key credential for authenticating with the Hostinger API.
  • The node makes HTTP requests to the Hostinger developer API endpoints at https://developers.hostinger.com.
  • No additional external dependencies are required beyond standard n8n credentials and HTTP request capabilities.

Troubleshooting

  • Unknown category error: Occurs if the selected category is not recognized. Ensure the category property is set to one of the supported values: Billing, DNS, Domains, Reach, VPS.
  • Unsupported action error: Happens if an invalid or unsupported action is selected for the given category/subcategory. Verify that the action matches the available options for the chosen category and subcategory.
  • Missing required IDs: Many actions require specific identifiers (e.g., Virtual Machine ID, Backup ID, Firewall ID). Omitting these will cause API errors. Make sure to provide all necessary IDs for the selected action.
  • Invalid JSON in Request Body: When using the raw JSON request body property, ensure the JSON is well-formed to avoid parsing errors.
  • API authentication errors: Confirm that the API key credential is correctly configured and has sufficient permissions.
  • HTTP request failures: Network issues or incorrect API endpoint usage may cause failures. Review the error messages and verify connectivity and parameter correctness.

Links and References

Discussion