Docs
Templates ›

Get sandbox template

GET/v1/sandboxes/{id}/template

Which template the sandbox is on, whether it is up to date with it, and the names of what it has from it.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. const template = await sandbox.template();
Answer200 OK · SandboxTemplate
  1. {
  2. "sandboxId": string,
  3. "templateId": string,
  4. "name": string,
  5. "default": boolean,
  6. "upToDate": boolean,
  7. "takenAt": string,
  8. "variables": string[],
  9. "hidden": string[],
  10. "files": string[],
  11. }

The sandbox's template.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

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

Returns

200 The sandbox's template.

SandboxTemplate9 fields
sandboxId
string
templateId
string
name
string
The template's name.
default
boolean
upToDate
boolean
Whether it has the template's variables, files and outbound rule as they are now.
More A sandbox takes them when it starts, when it is put on the template, and when POST /v1/templates/{id}/apply names it. A stopped one that is not up to date takes them at its next start.
takenAt
string
When it last took them.
variables
string[]
The names of the variables it has from the template: its own come on top of these.
hidden
string[]
Of those, the ones kept out of the sandbox, as it has them.
files
string[]
The paths of the files it has from the template: its own come on top of these.

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.