Application API

Manage application deployments programmatically

Overview

The Applications API provides functionality to create, read, update, and delete application deployments. Applications are associated with InstallImages and can be assigned to devices. The API supports comprehensive filtering, pagination, tag management, and customer permission validation.

POST Create Application

Creates a new application.

Request

{
  "cmd": "application.create",
  "name": "My Application",
  "imagecode": "ROCKYHARD9",
  "customerid": 1234,
  "description": "Application description",
  "deviceid": 5678,
  "configurationjson": "{\"key\":\"value\"}",
  "tags": [
    {"name": "environment", "data": "production"},
    {"name": "team", "data": "devops"}
  ]
}
<?php
$ch = curl_init('https://api.rackcorp.net/api/rest/v2.10/json.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'cmd' => 'application.create',
    'name' => 'My Application',
    'imagecode' => 'ROCKYHARD9',
    'customerid' => 1234,
    'description' => 'Application description',
    'deviceid' => 5678,
    'configurationjson' => '{"key":"value"}',
    'tags' => [
        ['name' => 'environment', 'data' => 'production'],
        ['name' => 'team', 'data' => 'devops']
    ]
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_JWT_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
import requests

response = requests.post(
    'https://api.rackcorp.net/api/rest/v2.10/json.php',
    json={
        'cmd': 'application.create',
        'name': 'My Application',
        'imagecode': 'ROCKYHARD9',
        'customerid': 1234,
        'description': 'Application description',
        'deviceid': 5678,
        'configurationjson': '{"key":"value"}',
        'tags': [
            {'name': 'environment', 'data': 'production'},
            {'name': 'team', 'data': 'devops'}
        ]
    },
    headers={
        'Authorization': 'Bearer YOUR_JWT_TOKEN',
        'Content-Type': 'application/json'
    }
)

data = response.json()
curl -X POST "https://api.rackcorp.net/api/rest/v2.10/json.php" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "application.create",
    "name": "My Application",
    "imagecode": "ROCKYHARD9",
    "customerid": 1234,
    "description": "Application description",
    "deviceid": 5678,
    "configurationjson": "{\"key\":\"value\"}",
    "tags": [
      {"name": "environment", "data": "production"},
      {"name": "team", "data": "devops"}
    ]
  }'

Parameters

Parameter Type Required Description
cmd string Yes Must be "application.create"
name string Yes Application name (must be unique per customer)
imagecode string Yes InstallImageCode - must exist and customer must have access
customerid integer No Customer ID (defaults to authenticated user's customer)
description string No Application description
deviceid integer No Device ID to assign application to (validated if provided)
datacenter_id integer No Datacentre for a new VM. Also accepted as dcid. Stored on configurationjson.productDetails.dcid. The customer and the install image must both offer that datacentre.
configurationjson string/object No JSON configuration data (max 64KB, must be valid JSON)
tags array No Array of tag objects (max 128 tags)

Tag Object Structure

{
  "name": "string (max 64 chars)",
  "data": "string (max 1024 chars)"
}

Response

{
  "code": "OK",
  "message": "Successfully Created",
  "application": {
    "id": 1,
    "name": "My Application",
    "description": "Application description",
    "customerid": 1234,
    "deviceid": 5678,
    "installimageid": 5,
    "imagecode": "ROCKYHARD9",
    "status": "ACTIVE",
    "operationalstatus": "PENDING",
    "datecreated": 1699123456,
    "datemodified": 1699123456,
    "version": 0,
    "configurationjson": "{\"key\":\"value\"}",
    "tags": {
      "environment": "production",
      "team": "devops"
    }
  }
}

GET Get Application

Retrieves a single application by ID.

Request

{
  "cmd": "application.get",
  "id": 1
}
<?php
$ch = curl_init('https://api.rackcorp.net/api/rest/v2.10/json.php?cmd=application.get&id=1');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_JWT_TOKEN'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
import requests

response = requests.get(
    'https://api.rackcorp.net/api/rest/v2.10/json.php',
    params={
        'cmd': 'application.get',
        'id': 1
    },
    headers={
        'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
)

data = response.json()
curl -X GET "https://api.rackcorp.net/api/rest/v2.10/json.php?cmd=application.get&id=1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
GET https://api.rackcorp.net/api/rest/v2.10/json.php?cmd=application.get&id=1
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Parameter Type Required Description
cmd string Yes Must be "application.get"
id integer Yes Application ID

Response

{
  "code": "OK",
  "application": {
    "id": 1,
    "name": "My Application",
    "description": "Application description",
    "customerid": 1234,
    "deviceid": 5678,
    "installimageid": 5,
    "imagecode": "ROCKYHARD9",
    "status": "ACTIVE",
    "operationalstatus": "RUNNING",
    "datecreated": 1699123456,
    "datemodified": 1699123456,
    "version": 2,
    "configurationjson": "{\"key\":\"value\"}",
    "tags": {
      "environment": "production",
      "team": "devops"
    }
  }
}

GET List Applications

Retrieves a list of applications with filtering, pagination, and sorting.

Request

{
  "cmd": "application.getall",
  "resStart": 0,
  "resWindow": 50,
  "keyword": "search term",
  "status": "ACTIVE"
}
<?php
$params = http_build_query([
    'cmd' => 'application.getall',
    'resStart' => 0,
    'resWindow' => 50,
    'keyword' => 'search term',
    'status' => 'ACTIVE'
]);

$ch = curl_init('https://api.rackcorp.net/api/rest/v2.10/json.php?' . $params);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_JWT_TOKEN'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
import requests

response = requests.get(
    'https://api.rackcorp.net/api/rest/v2.10/json.php',
    params={
        'cmd': 'application.getall',
        'resStart': 0,
        'resWindow': 50,
        'keyword': 'search term',
        'status': 'ACTIVE'
    },
    headers={
        'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
)

data = response.json()
curl -X GET "https://api.rackcorp.net/api/rest/v2.10/json.php?cmd=application.getall&resStart=0&resWindow=50&keyword=search%20term&status=ACTIVE" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
GET https://api.rackcorp.net/api/rest/v2.10/json.php?cmd=application.getall&resStart=0&resWindow=50&keyword=search%20term&status=ACTIVE
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Parameter Type Required Description
cmd string Yes Must be "application.getall"
resStart integer No Pagination start offset (default: 0)
resWindow integer No Number of results per page (default: 50000)
lastmodified integer No UTC timestamp - only return applications modified since this time
id integer No Filter by application ID
customerid integer No Filter by customer ID
name string No Filter by name (LIKE search)
keyword string No Search in name, description, and customer trading name
status string No Filter by ApplicationStatus (ACTIVE, INACTIVE, DELETED)
operationalstatus string No Filter by ApplicationOperationalStatus (PENDING, DEPLOYING, TESTING, RUNNING, DELETING, DELETED, FAILED)
deviceid integer No Filter by device ID
stdname string No Filter by customer trading name (LIKE search)
tag string No Match the category tag data (one value)
tags array No Filter by tags - must match ALL tags (AND logic). Each item is {"name","data"}
sort array No Array of sort objects (max 3 sorts)
Note: configurationjson is not included in getall results for performance. Use application.get to retrieve full details including configuration.

Response

{
  "code": "OK",
  "message": "Applications Retrieved Successfully",
  "count": 25,
  "applications": [
    {
      "id": 1,
      "name": "My Application",
      "description": "Application description",
      "customerid": 1234,
      "deviceid": 5678,
      "installimageid": 5,
      "status": "ACTIVE",
      "operationalstatus": "RUNNING",
      "datecreated": 1699123456,
      "datemodified": 1699123456,
      "version": 2,
      "tags": {
        "environment": "production",
        "team": "devops"
      }
    }
  ]
}

PUT Update Application

Updates an existing application.

Request

{
  "cmd": "application.update",
  "id": 1,
  "name": "Updated Application Name",
  "description": "Updated description",
  "status": "ACTIVE",
  "operationalstatus": "RUNNING",
  "deviceid": 5678,
  "tags": [
    {"name": "environment", "data": "staging"},
    {"name": "team", "data": "devops"}
  ]
}
<?php
$ch = curl_init('https://api.rackcorp.net/api/rest/v2.10/json.php');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'cmd' => 'application.update',
    'id' => 1,
    'name' => 'Updated Application Name',
    'description' => 'Updated description',
    'status' => 'ACTIVE',
    'operationalstatus' => 'RUNNING',
    'deviceid' => 5678,
    'tags' => [
        ['name' => 'environment', 'data' => 'staging'],
        ['name' => 'team', 'data' => 'devops']
    ]
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_JWT_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
import requests

response = requests.put(
    'https://api.rackcorp.net/api/rest/v2.10/json.php',
    json={
        'cmd': 'application.update',
        'id': 1,
        'name': 'Updated Application Name',
        'description': 'Updated description',
        'status': 'ACTIVE',
        'operationalstatus': 'RUNNING',
        'deviceid': 5678,
        'tags': [
            {'name': 'environment', 'data': 'staging'},
            {'name': 'team', 'data': 'devops'}
        ]
    },
    headers={
        'Authorization': 'Bearer YOUR_JWT_TOKEN',
        'Content-Type': 'application/json'
    }
)

data = response.json()
curl -X PUT "https://api.rackcorp.net/api/rest/v2.10/json.php" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "application.update",
    "id": 1,
    "name": "Updated Application Name",
    "description": "Updated description",
    "status": "ACTIVE",
    "operationalstatus": "RUNNING",
    "deviceid": 5678,
    "tags": [
      {"name": "environment", "data": "staging"},
      {"name": "team", "data": "devops"}
    ]
  }'

Parameters

id is required. You can change name, description, customerid, deviceid (0 clears it), status (ACTIVE, INACTIVE, DELETED), operationalstatus (PENDING, DEPLOYING, TESTING, RUNNING, DELETING, DELETED, FAILED), and tags. Sending tags replaces the whole set. imagecode and configurationjson cannot be changed here.

Response

{
  "code": "OK",
  "message": "Successfully Updated",
  "application": {
    "id": 1,
    "name": "Updated Application Name",
    "description": "Updated description",
    "customerid": 1234,
    "deviceid": 5678,
    "installimageid": 5,
    "imagecode": "ROCKYHARD9",
    "status": "ACTIVE",
    "operationalstatus": "RUNNING",
    "datecreated": 1699123456,
    "datemodified": 1699123500,
    "version": 3,
    "configurationjson": "{\"key\":\"value\"}",
    "tags": {
      "environment": "staging",
      "team": "devops"
    }
  }
}

DELETE Delete Application

Soft deletes an application (sets status to DELETED).

Request

{
  "cmd": "application.delete",
  "id": 1
}
<?php
$ch = curl_init('https://api.rackcorp.net/api/rest/v2.10/json.php');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'cmd' => 'application.delete',
    'id' => 1
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_JWT_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
import requests

response = requests.delete(
    'https://api.rackcorp.net/api/rest/v2.10/json.php',
    json={
        'cmd': 'application.delete',
        'id': 1
    },
    headers={
        'Authorization': 'Bearer YOUR_JWT_TOKEN',
        'Content-Type': 'application/json'
    }
)

data = response.json()
curl -X DELETE "https://api.rackcorp.net/api/rest/v2.10/json.php" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "application.delete",
    "id": 1
  }'

Parameters

Parameter Type Required Description
cmd string Yes Must be "application.delete"
id integer Yes Application ID to delete

Response

{
  "code": "OK",
  "message": "Application deleted"
}
Note: Delete sets status and operational status to DELETED and keeps the row. It also queues a safe shutdown of the application's server and removes the load balancer recorded on the application, when one exists.

application.reinstall

id is required. The current server, if any, is queued for cancel and purge. The application goes back to ACTIVE / PENDING with no device and no contract, so provisioning starts again. Deploy retry counters and anymeet.publicIp are cleared. A success response is {"code":"OK","message":"Reinstall started"}.

Access permissions

These calls edit the application's load balancer IP allow list. They fail until a load balancer has been provisioned.

CommandParametersReturns
application.accesspermissions.get id has_loadbalancer, loadbalancer_id, restricted, allowed_networks, clientip, iprestrictiondefaultpolicy
application.accesspermissions.update id, allowed_networks (array of IPv4 addresses or CIDRs; a bare address is stored as /32) The same object as get. An empty array sets the default policy to allow. A non-empty array sets the default to deny and allows only those networks.

Deploy actions

application.action needs id and action. action must be a name in that install image's deploy template. The application's server must already have an IP. application.anymeetupdate is the same call with action forced to update.

{
  "cmd": "application.action",
  "id": 1,
  "action": "update"
}

Notes

  • Version Field: The version field is automatically incremented on each update or delete operation
  • Delete: The row stays with status DELETED. The server is shut down and the application's load balancer is removed when those exist.
  • Tag Replacement: Updating tags replaces all existing tags with the new set
  • Configuration JSON: Once set during creation, configuration JSON cannot be modified
  • InstallImage: Once set during creation, the InstallImage cannot be changed
  • Pagination: Default window size is 50000, but smaller values are recommended for better performance
  • Tag Filtering: Tag filtering uses AND logic - all specified tags must match
  • Sorting: Maximum 3 sort fields are supported per request

Error Responses

If an error occurs, the API will return a response with code: "FAULT":

{
  "code": "FAULT",
  "message": "Error message",
  "error": {
    "field1": "Error message 1",
    "field2": "Error message 2"
  }
}