"description": "This API call returns the Gokapi server version in a readable format and as an integer.",
"operationId": "version",
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VersionInfo"
}
}
}
},
"401": {
"description": "Invalid API key provided for authentication"
}
}
}
},
"/info/config": {
"get": {
"tags": [
"info"
],
"summary": "Outputs Gokapi upload parameters",
"description": "This API call returns the Gokapi server upload parameters. All filesizes are in unit Megabyte. Requires API permission UPLOAD",
"operationId": "uploadconfig",
"security": [
{
"apikey": [
"UPLOAD"
]
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ConfigInfo"
}
}
}
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/files/downloadzip": {
"get": {
"tags": [
"files"
],
"summary": "Downloads files as ZIP file with optionally increasing the download counter",
"description": "This API call downloads multiple file that are not expired and increasing their download counter is disabled by default. Can be set up to return a pre-signed URL instead of the zip file itself, which is valid for 30 seconds and can be accessed by any registered user. End-to-end encrypted files and encrypted files stored on cloud servers cannot be downloaded. Returns 404 if an invalid/expired ID was passed. Requires API permission DOWNLOAD. To download files that were not uploaded by the user, the user needs to have the user permission LIST",
"operationId": "downloadzip",
"parameters": [
{
"name": "ids",
"in": "header",
"required": true,
"schema": {
"type": "string"
},
"description": "IDs of files to be downloaded seperated by comma"
},
{
"name": "filename",
"in": "header",
"required": false,
"schema": {
"type": "string"
},
"description": "The filename for the new Zip file. If the filename includes non-ANSI characters, you can encode them with base64, by adding 'base64:' at the beginning, e.g. 'base64:ZmlsZW5hbWU='"
},
{
"name": "increaseCounter",
"in": "header",
"required": false,
"schema": {
"type": "boolean"
},
"description": "Increase counter if set to true"
},
{
"name": "presignUrl",
"in": "header",
"required": false,
"schema": {
"type": "boolean"
},
"description": "Return a pre-signed URL instead of the actual file. Valid for one download within 30 seconds and can only be used by logged in users. When this option is set, download counter cannot be increased."
"description": "Invalid input or trying to download an end-to-end encrypted file"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
},
"404": {
"description": "Invalid ID provided or file has expired"
}
}
}
},
"/files/download/{id}": {
"get": {
"tags": [
"files"
],
"summary": "Downloads file with optionally increasing the download counter",
"description": "This API call downloads a file that is not expired and increasing its download counter is disabled by default. Can be set up to return a pre-signed URL instead of the file itself, which is valid for 30 seconds and can be accessed by any registered user. End-to-end encrypted files and encrypted files stored on cloud servers cannot be downloaded. Returns 404 if an invalid/expired ID was passed. Requires API permission DOWNLOAD. To download files that were not uploaded by the user, the user needs to have the user permission LIST",
"operationId": "downloadsingle",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of file to be downloaded"
},
{
"name": "increaseCounter",
"in": "header",
"required": false,
"schema": {
"type": "boolean"
},
"description": "Increase counter if set to true"
},
{
"name": "presignUrl",
"in": "header",
"required": false,
"schema": {
"type": "boolean"
},
"description": "Return a pre-signed URL instead of the actual file. Valid for one download within 30 seconds and can only be used by logged in users. When this option is set, download counter cannot be increased."
"description": "Invalid input or trying to download an end-to-end encrypted file"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
},
"404": {
"description": "Invalid ID provided or file has expired"
}
}
}
},
"/files/list": {
"get": {
"tags": [
"files"
],
"summary": "Lists all files",
"description": "This API call lists all files that are not expired. Returns null, if no files are stored. Requires API permission VIEW. To view files that were not uploaded by the user, the user needs to have the user permission LIST",
"operationId": "list",
"security": [
{
"apikey": [
"VIEW"
]
}
],
"parameters": [
{
"name": "showFileRequests",
"in": "header",
"required": false,
"schema": {
"type": "boolean"
},
"description": "Set to true, to include files uploaded through file requests"
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"type": "array",
"nullable": true,
"items": {
"$ref": "#/components/schemas/File"
}
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/files/list/{id}": {
"get": {
"tags": [
"files"
],
"summary": "Get metadata by ID",
"description": "This API call lists all metadata about a file that is not expired. Returns 404 if an invalid/expired ID was passed. Requires API permission VIEW. To view files that were not uploaded by the user, the user needs to have the user permission LIST",
"operationId": "listbyid",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "ID of file to be requested"
}
],
"security": [
{
"apikey": [
"VIEW"
]
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/File"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
},
"404": {
"description": "Invalid ID provided or file has expired"
}
}
}
},
"/chunk/add": {
"post": {
"tags": [
"chunk"
],
"summary": "Uploads a new chunk",
"description": "Uploads a file in chunks, in case a reverse proxy does not support upload of larger files. Parallel uploading is supported. Must call /chunk/complete after all chunks have been uploaded. WARNING: Does not support end-to-end encryption! If server is setup to utilise end-to-end encryption, file will be stored in plain-text! To upload an end-to-end encrypted file, use gokapi-cli. Chunks must be at least 5MB in size, unless last chunk of file. Requires API permission UPLOAD",
"operationId": "chunkadd",
"security": [
{
"apikey": [
"UPLOAD"
]
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/chunking"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/chunkUploadResult"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/chunk/complete": {
"post": {
"tags": [
"chunk"
],
"summary": "Finalises uploaded chunks",
"description": "Needs to be called after all chunks have been uploaded. Adds the uploaded file to Gokapi. Requires API permission UPLOAD",
"operationId": "chunkcomplete",
"security": [
{
"apikey": [
"UPLOAD"
]
}
],
"parameters": [
{
"name": "uuid",
"in": "header",
"description": "The unique ID that was used for the uploaded chunks",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filename",
"in": "header",
"description": "The filename of the uploaded file. If the filename includes non-ANSI characters, you can encode them with base64, by adding 'base64:' at the beginning, e.g. 'base64:ZmlsZW5hbWU='",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filesize",
"in": "header",
"description": "The total filesize of the uploaded file in bytes",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "contenttype",
"in": "header",
"description": "The MIME content type. If empty, application/octet-stream will be used.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "allowedDownloads",
"in": "header",
"description": "How many downloads are allowed. Default of 1 will be used if empty. Unlimited if 0 is passed.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "expiryDays",
"in": "header",
"description": "How many days the file will be stored. Default of 14 will be used if empty. Unlimited if 0 is passed.",
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "password",
"in": "header",
"description": "Password for this file to be set. No password will be used if empty.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "nonblocking",
"in": "header",
"description": "If set to true, the call returns without waiting for the file processing to finish.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadResult"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/uploadrequest/chunk/reserve": {
"post": {
"tags": [
"uploadrequest"
],
"summary": "Requests a UUID for uploading a new file for a file request",
"description": "Requests an UUID that can be used for uplading a new file. The chunks for the new file have to use this UUID. The first chunk needs to be uploaded latest 4 minutes after requesting the UUID. Requires API key associated with the file request",
"operationId": "chunkreserve",
"security": [
{
"apikey": [
"SPECIFIC_GUEST_API_KEY"
]
}
],
"parameters": [
{
"name": "id",
"in": "header",
"description": "The file request ID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/chunkReserveResult"
}
}
}
},
"400": {
"description": "Invalid ID or the file request does not accept any more files"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
},
"429": {
"description": "If too many chunks are currently requested, the caller has to wait a couple of seconds and try again. The rate limit is only for file requests that are not limited in file count"
}
}
}
},
"/uploadrequest/chunk/unreserve": {
"post": {
"tags": [
"uploadrequest"
],
"summary": "Frees a reserved UUID if upload was cancelled",
"description": "This call frees a reserved UUID, so that it does not count towards the quota anymore. Used if an upload was cancelled or failed. Requires API key associated with the file request",
"operationId": "chunkunreserve",
"security": [
{
"apikey": [
"SPECIFIC_GUEST_API_KEY"
]
}
],
"parameters": [
{
"name": "id",
"in": "header",
"description": "The file request ID",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "uuid",
"in": "header",
"description": "The reserved UUID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {}
}
},
"400": {
"description": "Invalid ID or the file request does not accept any more files"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
},
"429": {
"description": "If too many chunks are currently requested, the caller has to wait a couple of seconds and try again. The rate limit is only for file requests that are not limited in file count"
}
}
}
},
"/uploadrequest/chunk/add": {
"post": {
"tags": [
"uploadrequest"
],
"summary": "Uploads a new chunk for a file request",
"description": "Uploads a file in chunks. Parallel uploading is supported. Must call /uploadrequest/chunk/reserve to request an UUID first and must call /uploadrequest/chunk/complete after all chunks have been uploaded. WARNING: Does not support end-to-end encryption! If server is setup to utilise end-to-end encryption, file will be stored in plain-text! Chunks must be at least 5MB in size, unless last chunk of file. Requires API key associated with the file request",
"operationId": "chunkaddur",
"security": [
{
"apikey": [
"SPECIFIC_GUEST_API_KEY"
]
}
],
"parameters": [
{
"name": "fileRequestId",
"in": "header",
"description": "The ID of the upload request",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/chunking"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/chunkUploadResult"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/uploadrequest/chunk/complete": {
"post": {
"tags": [
"uploadrequest"
],
"summary": "Finalises uploaded chunks",
"description": "Needs to be called after all chunks have been uploaded. Adds the uploaded file to Gokapi. Requires API key associated with the file request",
"operationId": "chunkurcomplete",
"security": [
{
"apikey": [
"SPECIFIC_GUEST_API_KEY"
]
}
],
"parameters": [
{
"name": "uuid",
"in": "header",
"description": "The unique ID that was used for the uploaded chunks",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "fileRequestId",
"in": "header",
"description": "The file request ID that was used for the uploaded chunks",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filename",
"in": "header",
"description": "The filename of the uploaded file. If the filename includes non-ANSI characters, you can encode them with base64, by adding 'base64:' at the beginning, e.g. 'base64:ZmlsZW5hbWU='",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filesize",
"in": "header",
"description": "The total filesize of the uploaded file in bytes",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "contenttype",
"in": "header",
"description": "The MIME content type. If empty, application/octet-stream will be used.",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "nonblocking",
"in": "header",
"description": "If set to true, the call returns without waiting for the file processing to finish.",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadResult"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/logs/get": {
"get": {
"tags": [
"logs"
],
"summary": "Outputs server logs",
"description": "This API call returns the server logs with an optional cutoff timestamp to only send the newest logs. Requires API permission MANAGE_LOGS",
"operationId": "logsGet",
"security": [
{
"apikey": [
"MANAGE_LOGS"
]
}
],
"parameters": [
{
"name": "timestamp",
"in": "header",
"description": "Optional cutoff timestamp (Unix epoch in seconds) to filter logs",
"required": false,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"logEntries": {
"type": "string",
"description": "The server logs as a string"
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Timestamp of current time"
}
}
}
}
}
},
"401": {
"description": "Invalid API key provided for authentication"
}
}
}
},
"/logs/systemStatus": {
"get": {
"tags": [
"logs"
],
"summary": "Outputs server status information",
"description": "This API call returns information about the Gokapi server status. Requires API permission MANAGE_LOGS",
"operationId": "logsSystemStatus",
"security": [
{
"apikey": [
"MANAGE_LOGS"
]
}
],
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServerStatus"
}
}
}
},
"401": {
"description": "Invalid API key provided for authentication"
}
}
}
},
"/logs/delete": {
"delete": {
"tags": [
"logs"
],
"summary": "Deletes entries from the logfile",
"description": "This API call deletes all lines before older than a cutoff date. Requires API permission MANAGE_LOGS and user needs to be admin or super-admin.",
"operationId": "logsdelete",
"security": [
{
"apikey": [
"MANAGE_LOGS"
]
}
],
"parameters": [
{
"name": "timestamp",
"in": "header",
"required": false,
"schema": {
"type": "integer"
},
"description": "Unix timestamp of cutoff-date. All entries older than this timestamp will be deleted. To delete all entries, pass 0 or do not pass this parameter at all."
}
],
"responses": {
"200": {
"description": "Operation successful"
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/logs/resetTraffic": {
"delete": {
"tags": [
"logs"
],
"summary": "Reset traffic statistic",
"description": "This API call resets the statistic that counts outgoing traffic. Requires API permission MANAGE_LOGS and user needs to be admin or super-admin.",
"operationId": "logsresettraffic",
"security": [
{
"apikey": [
"MANAGE_LOGS"
]
}
],
"responses": {
"200": {
"description": "Operation successful"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/files/add": {
"post": {
"tags": [
"files"
],
"summary": "Adds a new file without chunking",
"description": "Uploads the submitted file to Gokapi. Please note: This method does not use chunking, therefore if you are behind a reverse proxy or have a provider that limits upload filesizes, this might not work for bigger files (e.g. Cloudflare). WARNING: Does not support end-to-end encryption! If server is setup to utilise end-to-end encryption, file will be stored in plain-text! To upload an end-to-end encrypted file, use gokapi-cli. Requires API permission UPLOAD",
"operationId": "add",
"security": [
{
"apikey": [
"UPLOAD"
]
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/body"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Operation successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadResult"
}
}
}
},
"400": {
"description": "Invalid input"
},
"401": {
"description": "Invalid API key provided for authentication or API key does not have the required permission"
}
}
}
},
"/files/duplicate": {
"post": {
"tags": [
"files"
],
"summary": "Duplicates an existing file",
"description": "This API call duplicates an existing file with new parameters. Requires API permission UPLOAD. To duplicate files that were not uploaded by the user, the user needs to have the user permission LIST",