Skip to content

Keep a task's changes in the real folder

POST
/tasks/{id}/keep
curl --request POST \
--url http://127.0.0.1:7700/api/tasks/t3k9x2a1b2/keep \
--header 'Authorization: Bearer <token>'

Preview, owner only. For a done task that worked on the owner’s real folders: applies its changes, one file at a time, each replaced atomically. A kept file keeps the real file’s owner, group and mode; a new file takes the owner of the folder it lands in. Before each file is written, its old version is saved under BOX_HOME/timemachine/<id>/, so the Keep can be undone with POST /tasks/{id}/unkeep.

If the owner changed, created or deleted any of the same files since the task started, nothing is applied in any folder and the response lists the clashing paths. The task’s review becomes kept or conflict, and a keep event goes into the log.

id
required
string

The task id.

Example

t3k9x2a1b2

The changes applied, or the conflicts that stopped them.

Media typeapplication/json
One of:
object
kept
required
Array<object>
object
path
required

Path inside the workspace.

string
change
required
string
Allowed values: added modified deleted

Examples

{
"kept": [
{
"path": "intro.md",
"change": "modified"
}
]
}

No such task, the task is not done or was already kept, or its workspace is not a real folder.

Media typeapplication/json
object
error
required

What went wrong

string

Example

{
"error": "task t3k9x2a1b2 is running; only a done task can be kept"
}

The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.

Media typeapplication/json
object
error
required

What went wrong

string

Example

{
"error": "only the box's own screen or the owner's paired device can do this"
}

GurtOS is open source under the Apache License 2.0.Source code on GitHub.