537 lines
13 KiB
JSON
537 lines
13 KiB
JSON
![]() |
openapi: 3.0.0
|
||
|
info:
|
||
|
title: General Bots API
|
||
|
description: API for managing files, documents, groups, conversations, and more.
|
||
|
version: 1.0.0
|
||
|
servers:
|
||
|
- url: https://api.generalbots.com/v1
|
||
|
description: Production server
|
||
|
paths:
|
||
|
/files/upload:
|
||
|
post:
|
||
|
summary: Upload a file
|
||
|
operationId: uploadFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
multipart/form-data:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
file:
|
||
|
type: string
|
||
|
format: binary
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File uploaded successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
url:
|
||
|
type: string
|
||
|
|
||
|
/files/download:
|
||
|
post:
|
||
|
summary: Download a file
|
||
|
operationId: downloadFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File downloaded successfully
|
||
|
content:
|
||
|
application/octet-stream:
|
||
|
schema:
|
||
|
type: string
|
||
|
format: binary
|
||
|
|
||
|
/files/copy:
|
||
|
post:
|
||
|
summary: Copy a file
|
||
|
operationId: copyFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
sourcePath:
|
||
|
type: string
|
||
|
destinationPath:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File copied successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/move:
|
||
|
post:
|
||
|
summary: Move a file
|
||
|
operationId: moveFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
sourcePath:
|
||
|
type: string
|
||
|
destinationPath:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File moved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/delete:
|
||
|
post:
|
||
|
summary: Delete a file
|
||
|
operationId: deleteFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File deleted successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/getContents:
|
||
|
post:
|
||
|
summary: Get file contents
|
||
|
operationId: getFileContents
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File contents retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
contents:
|
||
|
type: string
|
||
|
|
||
|
/files/save:
|
||
|
post:
|
||
|
summary: Save a file
|
||
|
operationId: saveFile
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
contents:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File saved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/createFolder:
|
||
|
post:
|
||
|
summary: Create a folder
|
||
|
operationId: createFolder
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
folderName:
|
||
|
type: string
|
||
|
parentFolderId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Folder created successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
folderId:
|
||
|
type: string
|
||
|
|
||
|
/files/shareFolder:
|
||
|
post:
|
||
|
summary: Share a folder
|
||
|
operationId: shareFolder
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
folderId:
|
||
|
type: string
|
||
|
userIds:
|
||
|
type: array
|
||
|
items:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Folder shared successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/dirFolder:
|
||
|
post:
|
||
|
summary: List folder contents
|
||
|
operationId: dirFolder
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
folderId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Folder contents retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
type:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/list:
|
||
|
post:
|
||
|
summary: List files
|
||
|
operationId: getFiles
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
folderId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Files listed successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
type:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/search:
|
||
|
post:
|
||
|
summary: Search files
|
||
|
operationId: searchFiles
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
query:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Files searched successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
type:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/recent:
|
||
|
post:
|
||
|
summary: Get recent files
|
||
|
operationId: getRecentFiles
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Recent files retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
type:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/favorite:
|
||
|
post:
|
||
|
summary: Toggle favorite status of a file
|
||
|
operationId: toggleFavorite
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Favorite status toggled successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
isFavorite:
|
||
|
type: boolean
|
||
|
|
||
|
/files/versions:
|
||
|
post:
|
||
|
summary: Get file versions
|
||
|
operationId: getFileVersions
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File versions retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
versionId:
|
||
|
type: string
|
||
|
timestamp:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/restore:
|
||
|
post:
|
||
|
summary: Restore a file version
|
||
|
operationId: restoreFileVersion
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
versionId:
|
||
|
type: string
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File version restored successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/permissions:
|
||
|
post:
|
||
|
summary: Set file permissions
|
||
|
operationId: setFilePermissions
|
||
|
requestBody:
|
||
|
required: true
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
fileId:
|
||
|
type: string
|
||
|
permissions:
|
||
|
type: object
|
||
|
responses:
|
||
|
'200':
|
||
|
description: File permissions updated successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/quota:
|
||
|
get:
|
||
|
summary: Get storage quota
|
||
|
operationId: getStorageQuota
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Storage quota retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
used:
|
||
|
type: integer
|
||
|
total:
|
||
|
type: integer
|
||
|
|
||
|
/files/shared:
|
||
|
get:
|
||
|
summary: Get shared files
|
||
|
operationId: getSharedFiles
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Shared files retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: array
|
||
|
items:
|
||
|
type: object
|
||
|
properties:
|
||
|
name:
|
||
|
type: string
|
||
|
type:
|
||
|
type: string
|
||
|
size:
|
||
|
type: integer
|
||
|
|
||
|
/files/sync/status:
|
||
|
get:
|
||
|
summary: Get sync status
|
||
|
operationId: getSyncStatus
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Sync status retrieved successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
status:
|
||
|
type: string
|
||
|
|
||
|
/files/sync/start:
|
||
|
post:
|
||
|
summary: Start sync
|
||
|
operationId: startSync
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Sync started successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|
||
|
|
||
|
/files/sync/stop:
|
||
|
post:
|
||
|
summary: Stop sync
|
||
|
operationId: stopSync
|
||
|
responses:
|
||
|
'200':
|
||
|
description: Sync stopped successfully
|
||
|
content:
|
||
|
application/json:
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
message:
|
||
|
type: string
|