List images
GET/api/v1/vm-templates
The systems a server can be created or reinstalled with.
Parameters
| Name | In | Description |
|---|---|---|
| include_inactive | query, boolean | Include deactivated templates. Default false (only selectable templates, for VM creation). Set true for display/name resolution of existing VMs whose template was later deactivated. |
Example request
curl -X GET "https://platform.serverscamp.com/api/v1/vm-templates" \
-H "Authorization: Bearer $API_TOKEN"import os, requests
token = os.environ["API_TOKEN"]
r = requests.get(
f"https://platform.serverscamp.com/api/v1/vm-templates",
headers={"Authorization": f"Bearer {token}"},
)
r.raise_for_status()
print(r.json())const r = await fetch(`https://platform.serverscamp.com/api/v1/vm-templates`, {
method: 'GET',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}` },
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| items | list of VmImagerequired | |
| items[].id | integerrequired | Image id, for vm_template_id in Create a VM and Reinstall |
| items[].name | stringrequired | Name, for example Ubuntu 26.04 LTS |
| items[].os_type | string, optional | Ubuntu, Debian, Rocky and so on |
| items[].os_family | string, optional | Linux |
| items[].version | string, optional | Version of the system |
| total | integerrequired |
{
"items": [
{
"id": 5,
"name": "Ubuntu 26.04 LTS",
"os_type": "Ubuntu",
"os_family": "linux",
"version": "26.04"
},
{
"id": 3,
"name": "Debian 13",
"os_type": "Debian",
"os_family": "linux",
"version": "13"
}
],
"total": 2
}Errors
| Status | When |
|---|---|
401 | No token, or a token that is not valid |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors