# edit

**.edit(SessionID, path, newContent)**

Delete a file or folder in a servers file manager.

| Parameter  | Type   | Required | Description                                            |
| ---------- | ------ | -------- | ------------------------------------------------------ |
| SessionID  | string | true     | The session ID that you want to perform this action on |
| path       | string | true     | The path of the file you wish to edit                  |
| newContent | string | true     | The new content to place in the file                   |

**Example:**

```javascript
// Dependencies
const CubedCraft = require('cubed-api');

// Editing the file
CubedCraft.files.edit('SessionID', '/plugins/Skript/scripts/decentskript.sk', 'on load:\n  broadcast "loaded"');
```

{% hint style="info" %}
Read the guide on session IDs: <https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/sessions>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pondwadermc.gitbook.io/cubed-api/documentation/files/edit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
