Docs
Templates ›

Get template files

GET/v1/templates/{id}/secrets/files

With path, one of the template's secret files and what it holds. Without, the paths of them all.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const template = await agental.templates.get("tpl_0123456789abcdef");
  4. const npmrc = await template.secrets.readFile(".npmrc");
Answer200 OK

No JSON body.

The file, or the paths of all of them.

Path

idrequired
string
e.g. "tpl_0123456789abcdef"

Query

path
string
A file's path, relative to the sandbox's working folder. Given, the answer is that file. Left out, it is the paths of them all. e.g. ".npmrc"

Headers

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

Returns

200 The file, or the paths of all of them.

Errors and other answers

400invalid_request the name, path or value is not one that can be kept.
400invalid_path the path leads out of the working folder.
404 Not found.

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