Skip to content

projects.php

Project management module for organizing servers into logical groups and assigning them to specific projects.

API Methods

Method Action Description
add add project Creates a new project with a specified name.
assign assign server to project Assigns a specific server to a project.
delete delete project Deletes one or more projects.
edit edit project Updates an existing project's details.
list get projects list Returns a list of all projects belonging to the user.
list_for_server get projects for server Returns a list of projects associated with a specific server.
view get project details Retrieves detailed information for a specific project.

projects/add

Creates a new project with a specified name.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: add
token ✅ string Authentication token.
params[name] ✅ string Name of the project to be created.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=add" \
--data "token=HOSTKEY_TOKEN" \
--data "params[name]=New Project"
Success response example
{
"result": "OK",
"action": "add",
"data": {
"id": 123,
"name": "New Project",
"customer_id": 456,
"created_at": "2024-01-15T10:30:00Z"
}
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/assign

Assigns a specific server to a project.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: assign
token ✅ string Authentication token.
params[id] ❌ integer ID of the project.
params[server_id] ❌ integer ID of the server to assign.
params[assign] ❌ integer Assignment mode or flag.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=assign" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=123" \
--data "params[server_id]=456" \
--data "params[assign]=1"
Success response example
{
"result": "OK",
"action": "assign",
"data": {
"id": 123,
"status": "assigned"
}
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/delete

Deletes one or more projects.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: delete
token ✅ string Authentication token.
params[id] ❌ integer ID of the project to delete.
params[server_ids][] ❌ array<integer> Accepts multiple values: server_ids[]=1&server_ids[]=2

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=delete" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=123" \
--data "params[server_ids][]=1" \
--data "params[server_ids][]=2"
Success response example
{
"result": "OK",
"action": "delete",
"data": {
"deleted_count": 1
}
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/edit

Updates an existing project's details.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: edit
token ✅ string Authentication token.
params[id] ❌ integer ID of the project to edit.
params[name] ❌ string New name for the project.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=edit" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=123" \
--data "params[name]=Updated Project Name"
Success response example
{
"result": "OK",
"action": "edit",
"data": {
"id": 123,
"name": "Updated Project Name"
}
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/list

Returns a list of all projects belonging to the user.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: list
token ✅ string Authentication token.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=list" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "list",
"data": [
{
"id": 1,
"name": "Project Alpha",
"customer_id": 456
},
{
"id": 2,
"name": "Project Beta",
"customer_id": 456
}
]
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/list_for_server

Returns a list of projects associated with a specific server.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: list_for_server
token ✅ string Authentication token.
params[server_id] ❌ integer ID of the server to filter projects by.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=list_for_server" \
--data "token=HOSTKEY_TOKEN" \
--data "params[server_id]=123"
Success response example
{
"result": "OK",
"action": "list_for_server",
"data": [
{
"id": 10,
"name": "Server Project A"
}
]
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

projects/view

Retrieves detailed information for a specific project.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: view
token ✅ string Authentication token.
params[id] ❌ integer ID of the project to view.

Request example

curl -s "https://invapi.hostkey.com/projects.php" -X POST \
--data "action=view" \
--data "token=HOSTKEY_TOKEN" \
--data "params[id]=123"
Success response example
{
"result": "OK",
"action": "view",
"data": {
"id": 123,
"name": "Project Details",
"customer_id": 456,
"created_at": "2024-01-15T10:30:00Z"
}
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×