Docs
Templates ›

List templates

GET/v1/templates

Your templates, default first. Every account has a template named default, which a sandbox is on when none is chosen.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const templates = await agental.templates.list();
Answer200 OK · TemplateList
  1. {
  2. "templates": [{
  3. "id": string,
  4. "name": string,
  5. "default": boolean,
  6. "start": TemplateStart,
  7. "variables": string[],
  8. "hidden": string[],
  9. … 9 more
  10. }],
  11. }

Templates.

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 Templates.

TemplateList1 field
templates
Template[]15 fields
id
string
name
string
default
boolean
Whether this is the account's default: the template a sandbox is on when none is chosen.
More It cannot be deleted or renamed.
start
TemplateStart3 fields
size
tinysmallmediumlarge
The size a sandbox made from the template is, when the create names none.
snapshotId
stringnull
The snapshot a sandbox made from the template starts as, when the create names none.
More Null starts a new machine.
ttlSeconds
integernull
Seconds a sandbox made from the template runs after each start before it is stopped, when the create names none.
More Null is the deployment's default.
variables
string[]
The names of its variables.
More A value is read one at a time.
hidden
string[]
Of its variables, the ones kept out of the sandbox.
files
string[]
The paths of its secret files.
More Contents are read one at a time.
network
TemplateNetwork2 fields
outbound
openblockedallowlist
What a sandbox on the template may reach outside itself, before its own addresses.
More open is the internet, which is what a sandbox has when nothing is asked. blocked lets nothing out: names still resolve, and no connection leaves. allowlist lets out only what goes to an address in allow. It is enforced outside the sandbox, on the server it runs on, so nothing running in the sandbox can change it, root included. What reaches the sandbox is not affected: commands, files and its public addresses work as before. Whatever this says, no sandbox reaches another sandbox or a private network, or delivers mail on port 25.
allow
string[]
The IPv4 addresses and ranges an allowlist lets out to, over any protocol and port.
More Empty for open and blocked.
ssh
TemplateSsh3 fields
enabled
boolean
Whether a sandbox made from the template has SSH turned on as it is made, as PUT /v1/sandboxes/{id}/ssh would: GET /v1/sandboxes/{id}/ssh then says where to connect.
enabledAt
stringnull
keys
SshKey[]
The public keys let in to a sandbox's machine as it is made, as POST /v1/sandboxes/{id}/ssh/keys would, in the order they were added.
More At most 50.
revision
integer
Raised by every change to its variables, files and outbound rule.
More A sandbox that has it at another revision is not up to date with it.
sandboxes
integer
How many sandboxes are on it.
tags
string[]
Tags every sandbox on it has, on top of its own.
More A change reaches them all at once, running or not.
metadata
object
Metadata every sandbox on it has, for the keys it does not set itself.
More A change reaches them all at once, running or not.
createdAt
string
updatedAt
string

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.