API reference
Files
File manager: list, read, write, upload, move, compress, trash, disk usage; protected folders.
#List protected folders
GET/api/v1/accounts/{id}/directory-privacy
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacyList · ky call privacyList
Parameters
Responses
- 200 OK
Body
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Password-protect a folder
POST/api/v1/accounts/{id}/directory-privacy
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacyCreate · ky call privacyCreate
Parameters
Request body
| Field | Type |
|---|
path | string |
realm | string |
Responses
- 200 OK
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready, validation
- 500 Internal Server Error: internal
#Remove a folder's protection
DELETE/api/v1/accounts/{id}/directory-privacy/{pid}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacyDelete · ky call privacyDelete
Parameters
Responses
- 200 OK
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Update a protected folder
PUT/api/v1/accounts/{id}/directory-privacy/{pid}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacyUpdate · ky call privacyUpdate
Parameters
Request body
Responses
- 200 OK
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Delete a protected folder's user
DELETE/api/v1/accounts/{id}/directory-privacy/{pid}/users/{user}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacyDeleteUser · ky call privacyDeleteUser
Parameters
| Name | In |
|---|
id | path |
pid | path |
user | path |
Responses
- 200 OK
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Add or update a protected folder's user
PUT/api/v1/accounts/{id}/directory-privacy/{pid}/users/{user}
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: directory-privacy
- Feature
directory_privacy- Operation
privacySetUser · ky call privacySetUser
Parameters
| Name | In |
|---|
id | path |
pid | path |
user | path |
Request body
Responses
- 200 OK
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: limit-reached, not-ready
- 500 Internal Server Error: internal
#List a folder
GET/api/v1/accounts/{id}/files
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesList · ky call filesList
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
items | array of any |
path | string |
- 400 Bad Request: file-operation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Change permissions
POST/api/v1/accounts/{id}/files/chmod
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesChmod · ky call filesChmod
Parameters
Request body
| Field | Type |
|---|
dir_mode | string |
file_mode | string |
mode | string |
paths | array of string |
recursive | boolean |
Responses
- 200 OK
Body
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Compress files
POST/api/v1/accounts/{id}/files/compress
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesCompress · ky call filesCompress
Parameters
Request body
| Field | Type |
|---|
dest | string |
format | string |
paths | array of string |
Responses
- 202 Accepted (runs in the background)
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Read a file
GET/api/v1/accounts/{id}/files/content
Opens a file in the code editor. The text travels through a staging file (it can be larger than one agent message).
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesRead · ky call filesRead
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
content | string |
encoding | string |
etag | string |
line_ending | string |
modified | integer |
path | string |
size | integer |
- 400 Bad Request: file-operation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Write a file
PUT/api/v1/accounts/{id}/files/content
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesWrite · ky call filesWrite
Parameters
Request body
| Field | Type |
|---|
content | string |
encoding | string |
etag | string |
line_ending | string |
path | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
etag | string |
modified | integer |
path | string |
size | integer |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Copy files
POST/api/v1/accounts/{id}/files/copy
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesCopy · ky call postAccountsIdFilesCopy
Parameters
Request body
| Field | Type |
|---|
dest | string |
overwrite | boolean |
paths | array of string |
Responses
- 200 OK
Body
| Field | Type |
|---|
count | integer |
paths | array of string |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Delete files permanently
POST/api/v1/accounts/{id}/files/delete
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesDelete · ky call postAccountsIdFilesDelete
Parameters
Request body
| Field | Type |
|---|
from | string |
path | string |
paths | array of string |
to | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
conflict | boolean |
conflicts | array of string |
content | string |
count | integer |
encoding | string |
etag | string |
items | array of any |
line_ending | string |
modified | integer |
path | string |
paths | array of string |
size | integer |
trash | array of any |
truncated | boolean |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Download a file
GET/api/v1/accounts/{id}/files/download
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesDownload · ky call filesDownload
Parameters
Responses
- 200 OK
- 400 Bad Request: file-operation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Create a folder
POST/api/v1/accounts/{id}/files/mkdir
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesMkdir · ky call postAccountsIdFilesMkdir
Parameters
Request body
| Field | Type |
|---|
from | string |
path | string |
paths | array of string |
to | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
conflict | boolean |
conflicts | array of string |
content | string |
count | integer |
encoding | string |
etag | string |
items | array of any |
line_ending | string |
modified | integer |
path | string |
paths | array of string |
size | integer |
trash | array of any |
truncated | boolean |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Move files
POST/api/v1/accounts/{id}/files/move
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesMove · ky call postAccountsIdFilesMove
Parameters
Request body
| Field | Type |
|---|
dest | string |
overwrite | boolean |
paths | array of string |
Responses
- 200 OK
Body
| Field | Type |
|---|
count | integer |
paths | array of string |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Rename a file or folder
POST/api/v1/accounts/{id}/files/rename
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesRename · ky call postAccountsIdFilesRename
Parameters
Request body
| Field | Type |
|---|
from | string |
path | string |
paths | array of string |
to | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
conflict | boolean |
conflicts | array of string |
content | string |
count | integer |
encoding | string |
etag | string |
items | array of any |
line_ending | string |
modified | integer |
path | string |
paths | array of string |
size | integer |
trash | array of any |
truncated | boolean |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Search files
GET/api/v1/accounts/{id}/files/search
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesSearch · ky call filesSearch
Parameters
| Name | In |
|---|
id | path |
hidden | query |
path | query |
q | query |
Responses
- 200 OK
Body
| Field | Type |
|---|
items | array of any |
path | string |
scanned | integer |
truncated | boolean |
- 400 Bad Request: file-operation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#List the trash
GET/api/v1/accounts/{id}/files/trash
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
trashList · ky call trashList
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
items | array of any |
retention_days | integer |
- 400 Bad Request: file-operation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Move files to the trash
POST/api/v1/accounts/{id}/files/trash
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
postAccountsIdFilesTrash · ky call postAccountsIdFilesTrash
Parameters
Request body
| Field | Type |
|---|
from | string |
path | string |
paths | array of string |
to | string |
Responses
- 200 OK
Body
| Field | Type |
|---|
conflict | boolean |
conflicts | array of string |
content | string |
count | integer |
encoding | string |
etag | string |
items | array of any |
line_ending | string |
modified | integer |
path | string |
paths | array of string |
size | integer |
trash | array of any |
truncated | boolean |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Empty the trash
POST/api/v1/accounts/{id}/files/trash/empty
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
trashEmpty · ky call trashEmpty
Parameters
Request body
| Field | Type |
|---|
ids | array of string |
Responses
- 200 OK
Body
| Field | Type |
|---|
count | integer |
size | integer |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Restore files from the trash
POST/api/v1/accounts/{id}/files/trash/restore
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
trashRestore · ky call trashRestore
Parameters
Request body
| Field | Type |
|---|
ids | array of string |
Responses
- 200 OK
Body
| Field | Type |
|---|
count | integer |
paths | array of string |
- 400 Bad Request: file-operation, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Upload files
POST/api/v1/accounts/{id}/files/upload
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
file_manager- Operation
filesUpload · ky call filesUpload
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
uploaded | array of string |
- 400 Bad Request: file-operation, invalid-body, upload
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Disk usage of a folder
GET/api/v1/accounts/{id}/files/usage
Returns the cached disk usage report of a folder ("report": null when it was never measured).
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
disk_usage- Operation
filesUsage · ky call filesUsage
Parameters
Responses
- 200 OK
Body
| Field | Type |
|---|
computed_at | integer |
path | string |
report | any |
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Measure a folder's disk usage again
POST/api/v1/accounts/{id}/files/usage
Measures a folder in the background (as the account's user) and caches the report.
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: files
- Feature
disk_usage- Operation
filesUsageRefresh · ky call filesUsageRefresh
Parameters
Request body
Responses
- 202 Accepted (runs in the background)
Body
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: not-ready
- 500 Internal Server Error: internal
#Save a folder's directory index setting
PUT/api/v1/accounts/{id}/indexes
- Who
- root, reseller (ACL: create-user-session); customer
- API tokens
- admin token area: accounts; account token area: indexes
- Feature
indexes- Operation
indexSave · ky call indexSave
Parameters
Request body
| Field | Type |
|---|
mode | string |
path | string |
Responses
- 202 Accepted (runs in the background)
Body
- 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal