Documentation
Search…
/actions

Description

Actions allow you to specify actions to take next time the specified project is loaded. There are two types of actions: file actions and exec actions. File actions can be used to create and update project files, while exec actions can be used to run a command when the sandbox is loaded.
put
https://api.next.tech
/v1/projects/:uid/actions
Actions

Supported Actions

The following actions are supported.

File Actions

Parameters

Action: file:create or file:update.
Key
Type
Required
Description
filename
string
yes
Name of file
contents
string
yes
Base64 string of file contents
open
boolean
no
If file should be opened by default when project loads (only supported for files in /home/nt-user/workspace)
repeat
boolean
no
If the action should continue to be replayed against all new sandboxes until overwritten (defaults to false)

Example Request Body

1
{
2
"actions": [
3
{
4
"action": "file:create",
5
"contents": "SGVsbG8sIFdvcmxkIQ==",
6
"filename": "/home/nt-user/workspace/hello_world.txt"
7
}
8
]
9
}
Copied!

Exec Actions

Action: exec.

Parameters

Key
Type
Required
Description
cmd
array
yes
The command to execute, specified as an array of strings with the command as the first element and the args as the following elements
stdin
string
no
Base64 string of input to provide to cmd
cwd
string
no
The directory to execute the command from (defaults to /home/nt-user/workspace)
repeat
boolean
no
If the action should continue to be replayed against all new sandboxes until overwritten (defaults to false)

Example Request Body

1
{
2
"actions": [
3
{
4
"action": "exec",
5
"cmd": ["mkdir", "tmp"],
6
"cwd": "/home/nt-user"
7
}
8
]
9
}
Copied!
Last modified 1yr ago