<aside> 📎 Endpoints

</aside>

Get directory contents

GET https://your-panel.com/api/client/servers/<UUID>/files/directory

Required Parameters

path - path to the directory. / would display the root directory.

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/directory" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X GET \\
  -d '
	   {
	       "path": "/"
	   }'

Example Response

{
    "object": "list",
    "data": [
        {
            "object": "file",
            "attributes": {
                "type": "directory",
                "name": "config",
                "size": 4096,
                "mime": "inode/directory",
                "symlink": false,
                "created_at": "2021-09-21T03:13:36.948Z",
                "modified_at": "2020-04-19T22:28:18.000Z"
            }
        },
        {
            "object": "file",
            "attributes": {
                "type": "directory",
                "name": "mods",
                "size": 12288,
                "mime": "inode/directory",
                "symlink": false,
                "created_at": "2021-09-21T03:13:37.012Z",
                "modified_at": "2020-04-20T01:55:44.000Z"
            }
        },
    ],
    "meta": {
        "pagination": {
            "total": 9,
            "count": 9,
            "perPage": 10,
            "currentPage": 1,
            "totalPages": 1
        }
    }
}

Create a directory

POST https://your-panel.com/api/client/servers/<UUID>/files/directory

Required Parameters

path - path to the directory

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/directory" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X POST \\
  -d '
	   {
	       "path": "/"
	   }'

Example Response


Read a file

GET https://your-panel.com/api/client/servers/<UUID>/files/read

Required Parameters

path - path to the directory

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/read" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X GET \\
  -d '
	   {
	       "path": "/test.txt"
	   }'

Example Response

{
    "content": "this is a test content of a new file"
}

Write a file

POST https://your-panel.com/api/client/servers/<UUID>/files/write

<aside> ⚠ī¸ Overwrites the file if it already exists.

</aside>

Required Fields

path - path to the file

content - new content of the file

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/write" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X POST \\
  -d '
	   {
	       "path": "/test.txt",
	       "content": "this is a test content of a new file"
	   }'

Response code 204 for successful request

Copy a file

POST https://your-panel.com/api/client/servers/<UUID>/files/copy

<aside> ℹī¸ New copy will be written to the same directory, with a name such as test.txt copy-1643810941850

</aside>

Required Fields

path - path to the file

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/copy" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X POST \\
  -d '
	   {
	       "path": "/test.txt"
	   }'

Response code 204 for successful request

Delete a file

DELETE https://your-panel.com/api/client/servers/<UUID>/files/delete

Required Fields

path - path to the file

Example Request

curl "<https://your-panel.com/api/client/servers/><UUID>/files/delete" \\
  -H "Content-Type: application/json" \\
  -H "Accept: application/vnd.wisp.v1+json" \\
  -H "Authorization: Bearer APITOKEN" \\
  -X DELETE \\
  -d '
	   {
	       "path": "/test.txt"
	   }'

Response code 204 for successful request