v1

latestOpenAPI 3.1.02026-07-2631411.5 MB
Context - Runtime

Edit runtime sandbox file

Replace occurrences of oldString with newString in a file in the workspace runtime sandbox, then push the change to the workspace's default branch on GitHub. By default oldString must occur exactly once; pass replaceAll: true to replace every occurrence.

patch/context/runtime/content

Request body

pathstring required

Path of the file to edit, relative to the workspace working directory.

oldStringstring required

The exact substring to replace. Must occur exactly once unless replaceAll is true.

newStringstring required

Replacement string. May be empty to delete the match. Must differ from oldString.

replaceAllboolean

When true, replace every occurrence of oldString instead of requiring a single match.

commitMessagestring

Optional commit message override. Defaults to 'context(runtime): edit <path>'.

Response

Successful response