API docs

zpe files

mount /files · base https://zpe.vc/files · v5.0.0 · 15 operations · 10 write · 0 need no account · beta

the document this app serves now. Contract: https://zpe.vc/files/_/api/v1/openapi.json · sha256 26f28ec4228a

POST /_/api/v1/copy Copy a file or a whole folder to another path postCopy

Copy a file or a whole folder to another path

Parameters

nameinrequiredtypenotes
fromquerynostringThe file or folder to copy. Send it here or as `from` in a JSON body.
overwritequerynobooleanReplace the destination when it already exists. Default false.
toquerynostringWhere the copy goes. Send it here or as `to` in a JSON body.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The file was copied. `from` still exists: a copy does not move it.object
400`from` or `to` is missing, is not a usable key, names the internal prefix, is the same as the other, or sits inside it; or the JSON body could not be read.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`from` names nothing in this account's prefix.object
409`to` is already there and `overwrite` was not asked for.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Copy a file or a whole folder to another path, with a token from the door.

POST /_/api/v1/copy
curl -X POST 'https://zpe.vc/files/_/api/v1/copy?from=string&overwrite=false&to=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/counts Count the direct children of one or more folders postCounts

Count the direct children of one or more folders

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200One count per folder, keyed by path. A folder that could not be counted is absent rather than zero, so a missing key means `unknown`, not `empty`.object
400The JSON body could not be read, so there were no folders to count.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Count the direct children of one or more folders, with a token from the door.

POST /_/api/v1/counts
curl -X POST 'https://zpe.vc/files/_/api/v1/counts' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/delete Delete a file or folder, or move it to the trash with `?soft=1` deleteDelete

Delete a file or folder, or move it to the trash with `?soft=1`

Parameters

nameinrequiredtypenotes
pathqueryyesstringThe file or folder to delete, relative to the account's prefix.
softquerynobooleanMove it to the trash instead of deleting it.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200It is gone, or — with `soft` — it moved to the trash and this is the `trashKey` a restore takes.object
400`path` is missing or is not a usable key, or names the internal prefix.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`path` names nothing in this account's prefix.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Delete a file or folder, or move it to the trash with `?soft=1`, with a token from the door.

DELETE /_/api/v1/delete
curl -X DELETE 'https://zpe.vc/files/_/api/v1/delete?path=string&soft=false' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/download Download one file's bytes getDownload

Download one file's bytes

Parameters

nameinrequiredtypenotes
pathqueryyesstringThe object key to read, relative to the account's prefix.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The file's bytes, with its type, length and `ETag`.object
206Part of the file's bytes, when the request carried a `Range` header.object
400`path` is missing or is not a usable key, or names a folder: a folder has no bytes to send.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`path` names nothing in this account's prefix.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Download one file's bytes, with a token from the door.

GET /_/api/v1/download
curl -X GET 'https://zpe.vc/files/_/api/v1/download?path=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/list List one folder, sorted, folders first getList

List one folder, sorted, folders first

Parameters

nameinrequiredtypenotes
cursorquerynostringThe `nextCursor` a previous page answered, to read the next one.
limitquerynointegerHow many entries to answer. The whole folder when absent.
pathquerynostringThe folder to list, relative to the account's prefix. The root when absent.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The folder's entries, folders first, and a `nextCursor` when there is another page.object
400`path` is not a usable key, names a file rather than a folder, or `limit` is outside 1-1000.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`path` names no folder in this account's prefix.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

List one folder, sorted, folders first, with a token from the door.

GET /_/api/v1/list
curl -X GET 'https://zpe.vc/files/_/api/v1/list?cursor=string&limit=0&path=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/mkdir Create a folder, with its parent markers postMkdir

Create a folder, with its parent markers

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringA value that names this attempt. Send the same one when retrying and the answer is what the first call wrote (`200`) instead of a second object; present and empty is refused.
pathqueryyesstringThe folder to create, relative to the account's prefix.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Nothing new was written: this `Idempotency-Key` already created that folder, or the folder was already there. `created` is `false` and `existed` says what was found.object
201The folder was created, with its parent markers.object
400The request could not be readobject
401The credential is missing or does not open this accountobject
403This account may not do thatobject
404Nothing is hereobject
409A file of that name is already there, so a folder cannot take the address.object
429Too many requestsobject

Example

Create a folder, with its parent markers, with a token from the door.

POST /_/api/v1/mkdir
curl -X POST 'https://zpe.vc/files/_/api/v1/mkdir?path=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{
  "key": "string",
  "created": false,
  "existed": "directory"
}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/rename Rename or move a file or folder postRename

Rename or move a file or folder

Parameters

nameinrequiredtypenotes
fromquerynostringThe file or folder to move. Send it here or as `from` in a JSON body.
overwritequerynobooleanReplace the destination when it already exists. Default false.
toquerynostringIts new path. Send it here or as `to` in a JSON body.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200It moved, and `from` no longer exists.object
400`from` or `to` is missing or is not a usable key, is the same as the other or sits inside it, names the internal prefix, or `overwrite` was asked for on a folder move; or the JSON body could not be read.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`from` names nothing in this account's prefix.object
409`to` is already there, and either `overwrite` was not asked for or the destination is a folder.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Rename or move a file or folder, with a token from the door.

POST /_/api/v1/rename
curl -X POST 'https://zpe.vc/files/_/api/v1/rename?from=string&overwrite=false&to=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/search Search the account's files by name getSearch

Search the account's files by name

Parameters

nameinrequiredtypenotes
cursorquerynostringThe `nextCursor` a previous page answered, to read the next one.
limitquerynointegerHow many hits to answer. Default 100.
matchqueryno"name"`name` matches a file's whole name instead of a substring of it, for a caller that knows the name it wants.
prefixquerynostringOnly search under this folder, relative to the account's prefix.
qquerynostringThe text to find in a file's name. An empty one answers nothing rather than everything.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The names that matched, and a `nextCursor` when the scan stopped with more to read. An empty `q` answers an empty page rather than every file.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Search the account's files by name, with a token from the door.

GET /_/api/v1/search
curl -X GET 'https://zpe.vc/files/_/api/v1/search?cursor=string&limit=0&match=name&prefix=string&q=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/stat Read one file's metadata without its bytes getStat

Read one file's metadata without its bytes

Parameters

nameinrequiredtypenotes
pathqueryyesstringThe object key to read the metadata of, relative to the account's prefix.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200One file's or folder's metadata, without its bytes. A folder answers `kind: directory`.object
400`path` is missing or is not a usable key, or names the internal prefix.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
404`path` names nothing in this account's prefix.object
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Read one file's metadata without its bytes, with a token from the door.

GET /_/api/v1/stat
curl -X GET 'https://zpe.vc/files/_/api/v1/stat?path=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/trash List the trash, restore from it, or empty it getTrash

List the trash, restore from it, or empty it

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Everything in the trash, including entries whose retention has just run out and been purged.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

List the trash, restore from it, or empty it, with a token from the door.

GET /_/api/v1/trash
curl -X GET 'https://zpe.vc/files/_/api/v1/trash' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/trash List the trash, restore from it, or empty it postTrash

List the trash, restore from it, or empty it

Parameters

nameinrequiredtypenotes
actionqueryno"restore"`restore` restores the keys named in the body. Absent, the body's keys are soft-deleted instead.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200`action=restore` answers one result per `trashKey` — restored, or why it could not be. Without it, the body's `keys` moved to the trash and this is each one's id.object
400The JSON body could not be read, or — without `action=restore` — carried no `keys` to move.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

List the trash, restore from it, or empty it, with a token from the door.

POST /_/api/v1/trash
curl -X POST 'https://zpe.vc/files/_/api/v1/trash?action=restore' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/trash List the trash, restore from it, or empty it deleteTrash

List the trash, restore from it, or empty it

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
204The named `trashKeys` — or everything, with `all` — were removed from the trash and their bytes with them. Nothing to send back.
400The JSON body could not be read, so there were no entries to remove.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

List the trash, restore from it, or empty it, with a token from the door.

DELETE /_/api/v1/trash
curl -X DELETE 'https://zpe.vc/files/_/api/v1/trash' \
  -H 'Authorization: Bearer $ZPE_TOKEN'

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/upload Upload a file, or write and remove one raw PUT at a time postUpload

Upload a file, or write and remove one raw PUT at a time

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringA value that names this attempt. Send the same one when retrying and the answer is what the first call wrote (`200`) instead of a second object; present and empty is refused.
overwritequerynobooleanReplace a file of the same name. Default false.
pathquerynostringThe folder to write into — or, with `uploads`, the file key the multipart upload is for.
uploadIdquerynostringComplete the multipart upload this id names, with the parts in a JSON body.
uploadsquerynobooleanStart a multipart upload and answer its `uploadId`. Send it with no value.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Nothing new was written: this `Idempotency-Key` already answered here, and this is what the first call wrote — the same key, name, size and `uploadId`.object
201The file was written, or — with `uploads` — a multipart upload was started and this is its `uploadId`.object
400The request could not be readobject
401The credential is missing or does not open this accountobject
403This account may not do thatobject
404Nothing is hereobject
409The destination is a folder, so it cannot be replaced by this file.object
413The body is larger than this deployment accepts in one request.object
429Too many requestsobject

Example

Upload a file, or write and remove one raw PUT at a time, with a token from the door.

POST /_/api/v1/upload
curl -X POST 'https://zpe.vc/files/_/api/v1/upload?overwrite=false&path=string&uploadId=string&uploads=false' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{
  "key": "string",
  "name": "string",
  "size": 0,
  "path": "string",
  "overwritten": false,
  "uploadId": "string"
}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

PUT /_/api/v1/upload Upload a file, or write and remove one raw PUT at a time putUpload

Upload a file, or write and remove one raw PUT at a time

Parameters

nameinrequiredtypenotes
partNumberqueryyesintegerWhich part this body is, counted from 1.
pathqueryyesstringThe file key this part belongs to.
uploadIdqueryyesstringThe multipart upload this part belongs to.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The part was written, and this is its `partNumber` and `ETag` for the completing call.object
400`path`, `uploadId` or `partNumber` is missing or is not usable, the request carried no body, or the upload refused the part.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Upload a file, or write and remove one raw PUT at a time, with a token from the door.

PUT /_/api/v1/upload
curl -X PUT 'https://zpe.vc/files/_/api/v1/upload?partNumber=0&path=string&uploadId=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

DELETE /_/api/v1/upload Upload a file, or write and remove one raw PUT at a time deleteUpload

Upload a file, or write and remove one raw PUT at a time

Parameters

nameinrequiredtypenotes
pathqueryyesstringThe file key the abandoned upload was for.
uploadIdqueryyesstringThe multipart upload to abandon.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
204The multipart upload was abandoned and its parts are gone. An `uploadId` that was never live is treated as already abandoned, so this answer is idempotent.
400`path` or `uploadId` is missing or is not a usable key.object
401The credential is missing or does not open this accountobject
403This account may not do that: the key's scope does not cover this method, or the door's grant does not name this appobject
429Too many requests: this key has spent its request ceiling, and `Retry-After` says when to come backobject
500This app failed while answeringobject
503A service this app needs did not answer — the door could not be reached, so this request was not checkedobject

Example

Upload a file, or write and remove one raw PUT at a time, with a token from the door.

DELETE /_/api/v1/upload
curl -X DELETE 'https://zpe.vc/files/_/api/v1/upload?path=string&uploadId=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.