Templates ›
Set template file
PUT
/v1/templates/{id}/secrets/filesSets one of the template's secret files, which is written into it, relative to its working folder, before every command. A sandbox on the template takes the change when it next starts, or when POST /v1/templates/{id}/apply names it.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const template = await agental.templates.get("tpl_0123456789abcdef");
- await template.secrets.writeFile(".npmrc", npmrc);
Answer200 OK · SecretFile
- {
- "path": string,
- "text": string,
- }
The file as it is kept, with its path written one way.
Path
idrequiredstring | e.g. "tpl_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
pathrequiredstring | |
textrequiredstring |
Returns
200 The file as it is kept, with its path written one way.
SecretFile2 fields
pathstring
textstring
Errors and other answers
| 400 | invalid_request the name, path or value is not one that can be kept. |
| 400 | invalid_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.