oCoreoCore Docs
API Reference

File Editor

List server files

Lists files and directories at the given path on a server.

GET
/servers/{id}/files

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Server ID (UUID)

Query Parameters

pathstring

Directory path

Default: "/opt/ocore"
curl -X GET "//api.ocore.dev/api/servers/<string>/files?path=%2Fopt%2Focore" \
  -H "Authorization: <token>"

OK

{
  "files": [
    {}
  ],
  "path": "string"
}

Delete server file

Deletes a file at the specified path on the server.

DELETE
/servers/{id}/files

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Server ID (UUID)

Query Parameters

pathRequiredstring

File path to delete

curl -X DELETE "//api.ocore.dev/api/servers/<string>/files?path=%3Cstring%3E" \
  -H "Authorization: <token>"

OK

{
  "message": "string",
  "path": "string"
}

Get file info

Returns detailed metadata about a file on the server.

GET
/servers/{id}/files/info

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Server ID (UUID)

Query Parameters

pathRequiredstring

File path

curl -X GET "//api.ocore.dev/api/servers/<string>/files/info?path=%3Cstring%3E" \
  -H "Authorization: <token>"

OK

{}

Read server file

Reads and returns the content of a file on the server.

GET
/servers/{id}/files/read

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Server ID (UUID)

Query Parameters

pathRequiredstring

File path to read

curl -X GET "//api.ocore.dev/api/servers/<string>/files/read?path=%3Cstring%3E" \
  -H "Authorization: <token>"

OK

{
  "content": "string",
  "path": "string"
}

List server file tree

Returns a recursive file listing up to the specified depth on the server.

GET
/servers/{id}/files/tree

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Server ID (UUID)

Query Parameters

pathstring

Root path

Default: "/opt/ocore"
depthinteger

Maximum recursion depth

Default: 3
curl -X GET "//api.ocore.dev/api/servers/<string>/files/tree?path=%2Fopt%2Focore&depth=3" \
  -H "Authorization: <token>"

OK

{
  "depth": 0,
  "files": [
    {}
  ],
  "path": "string"
}

Write server file

Writes content to a file on the server.

PUT
/servers/{id}/files/write

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Request Body

application/jsonRequired

File path and content

contentstring
pathstring

Path Parameters

idRequiredstring

Server ID (UUID)

curl -X PUT "//api.ocore.dev/api/servers/<string>/files/write" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "string",
    "path": "string"
  }'

OK

{
  "message": "string",
  "path": "string"
}

Was this page helpful?