Commands and files ›
Write file
PUT
/v1/sandboxes/{id}/filesWrite a file.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- await sandbox.files.write("app/main.py", source);
Answer200 OK · FileWritten
- {
- "path": string,
- "bytes": integer,
- }
File written into the sandbox directory.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
pathrequiredstring | |
textstring | |
base64string |
Returns
200 File written into the sandbox directory.
FileWritten2 fields
pathstring
bytesinteger
Errors and other answers
| 400 | Send exactly one of text or base64. |
| 404 | Not found. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.