oCoreoCore Docs
API Reference

Files

List instance files

Lists files at the instance's addon directory or a custom path.

GET
/instances/{id}/files

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Instance ID (UUID)

Query Parameters

pathstring

Directory path to list

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

OK

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

Read instance file

Reads a file from the instance's server, scoped to the instance directory.

GET
/instances/{id}/files/read

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Instance ID (UUID)

Query Parameters

pathRequiredstring

File path to read

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

OK

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

List instance file tree

Returns a recursive file listing at the instance's addon directory up to a given depth.

GET
/instances/{id}/files/tree

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Instance ID (UUID)

Query Parameters

pathstring

Root path for tree listing

depthinteger

Maximum recursion depth

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

OK

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

Write instance file

Writes content to a file on the instance's server. Includes python_file flag for .py files.

PUT
/instances/{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

Instance ID (UUID)

curl -X PUT "//api.ocore.dev/api/instances/<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?