Skip to content

Presets

API Methods

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

presets/groups

Returns a list of preset groups

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: groups
- - - No other parameters

Example Request

curl -s "https://api.hostkey.com/presets.php" -X POST \
--data "action=groups"
Example of a successful response
{
"groups": [
  {
    "id": 1,
    "name": "Standard",
    "count": 5
  }
]
}
Failure response
{
"code": -1,
"message": "Internal server error"
}

presets/info

Returns a list of presets for resellers with prices in specified currencies

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: info
currencies string Comma-separated list of currencies (e.g., EUR,USD). If not specified, EUR and USD are used by default

Example Request

curl -s "https://api.hostkey.com/presets.php" -X POST \
--data "action=info"
Example of a successful response
{
"result": "OK",
"action": "info",
"presets": [
  {
    "id": 101,
    "name": "VPS Basic",
    "price": {
      "EUR": 10.0,
      "USD": 11.0
    },
    "location": "NL",
    "cpu": "2 vCPU",
    "ram": "4 GB",
    "hdd": "50 GB SSD"
  }
]
}
Failure response
{
"code": -1,
"message": "Invalid currency format",
"description": "Error processing the currencies parameter (invalid format)"
}

presets/list

Returns a list of available presets with filtering by location and access rights

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: list
location string Location code (e.g., NL, DE) or location ID
token string Authorization token for accessing private data (affects the display of the total field)

Example Request

curl -s "https://api.hostkey.com/presets.php" -X POST \
--data "action=list"
Example of a successful response
{
"result": "OK",
"action": "list",
"presets": [
  {
    "id": 1,
    "name": "Starter Plan",
    "Code": "NL-AMS",
    "amount": 10,
    "available": 5,
    "component_id": 12,
    "price": {
      "EUR": 15.0,
      "USD": 16.0
    },
    "server_type": "VPS",
    "tags": [
      {
        "id": 1,
        "name": "fast"
      }
    ],
    "total": 10
  }
]
}
Failure response
{
"code": -1,
"message": "No presets found",
"description": "Returned if the presets_list function returned -1 (no data)"
}

presets/search

Searches for suitable servers for a specific preset by name

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: search
name string Preset name to search for
scope string Search scope: free or all
location string Location code
token string Authorization token

Example Request

curl -s "https://api.hostkey.com/presets.php" -X POST \
--data "action=search" \
--data "name=VALUE" \
--data "token=HOSTKEY_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "search",
"servers": [
  {
    "id": 501,
    "name": "Server-01",
    "location": "NL",
    "days_left": 30,
    "due_date": "2024-12-31"
  }
]
}
Failure response
{
"code": -1,
"message": "Invalid token, logout"
}

presets/show

Returns detailed information about a preset by ID or name

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: show
id int Preset ID
name string Preset name
limit int Limit on the number of records returned
token string Authorization token for checking country restrictions

Example Request

curl -s "https://api.hostkey.com/presets.php" -X POST \
--data "action=show"
Example of a successful response
{
"result": "OK",
"action": "show",
"presets": [
  {
    "id": 1,
    "name": "Premium VPS",
    "description": "High performance server",
    "cpu": "4 vCPU",
    "ram": "8 GB",
    "hdd": "100 GB NVMe",
    "gpu": "NVIDIA T4",
    "location": "DE",
    "price": {
      "EUR": 49.99,
      "USD": 54.99
    },
    "tags": [
      {
        "id": 10,
        "name": "gaming"
      },
      {
        "id": 11,
        "name": "ai"
      }
    ],
    "active": true
  }
]
}
Failure response
{
"code": -1,
"message": "JSON encode failed"
}

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×