# Applications

## Upload application

> Upload a new application to Discloud

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/upload":{"post":{"tags":["Applications"],"summary":"Upload application","description":"Upload a new application to Discloud","operationId":"uploadApplication","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Application file to upload (.ZIP format)"}}}}}},"responses":{"200":{"description":"Upload response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}},{"$ref":"#/components/schemas/UploadErrorResponse"}]}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Missing required file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Get application information

> Retrieves information about a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"apps":{"oneOf":[{"$ref":"#/components/schemas/App"},{"type":"array","items":{"$ref":"#/components/schemas/App"}}]}}},"App":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the application"},"avatarURL":{"type":"string","description":"URL to the application's avatar image"},"name":{"type":"string","description":"Name of the application"},"type":{"type":"integer","description":"Type of the application"},"online":{"type":"boolean","description":"Whether the application is currently online"},"ramKilled":{"type":"boolean","description":"Whether the application was terminated due to RAM usage"},"exitCode":{"type":"integer","description":"Exit code of the application if it has stopped"},"ram":{"type":"integer","description":"RAM allocated to the application (in MB)"},"mainFile":{"type":"string","description":"Main file path of the application"},"lang":{"type":"string","description":"Programming language of the application"},"mods":{"type":"array","items":{"type":"string"},"description":"Additional modules or dependencies"},"autoDeployGit":{"type":"string","description":"Git auto-deployment setting"},"autoRestart":{"type":"boolean","description":"Whether the application auto-restarts on failure"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}":{"get":{"tags":["Applications"],"summary":"Get application information","description":"Retrieves information about a specific application or all applications","operationId":"getAppInfo","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to retrieve all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application information retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Get application status

> Retrieves status information about a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppStatusResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"apps":{"oneOf":[{"$ref":"#/components/schemas/AppStatus"},{"type":"array","items":{"$ref":"#/components/schemas/AppStatus"}}]}}},"AppStatus":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the application"},"container":{"type":"string","description":"Status of the application container"},"cpu":{"type":"string","description":"Current CPU usage of the application"},"memory":{"type":"string","description":"Current memory usage and allocation"},"ssd":{"type":"string","description":"Storage space used by the application"},"netIO":{"type":"object","properties":{"down":{"type":"string","description":"Network download usage"},"up":{"type":"string","description":"Network upload usage"}}},"last_restart":{"type":"string","description":"Time since the last application restart"},"startedAt":{"type":"string","format":"date-time","description":"Timestamp when the application was started"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/status":{"get":{"tags":["Applications"],"summary":"Get application status","description":"Retrieves status information about a specific application or all applications","operationId":"getAppStatus","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to retrieve status for all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStatusResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Get application logs

> Retrieves logs for a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppLogsResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"apps":{"oneOf":[{"$ref":"#/components/schemas/AppLogs"},{"type":"array","items":{"$ref":"#/components/schemas/AppLogs"}}]}}},"AppLogs":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the application"},"terminal":{"type":"object","properties":{"big":{"type":"string","description":"Complete application logs"},"small":{"type":"string","description":"Condensed application logs"},"url":{"type":"string","description":"URL to view logs online"}}}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/logs":{"get":{"tags":["Applications"],"summary":"Get application logs","description":"Retrieves logs for a specific application or all applications","operationId":"getAppLogs","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to retrieve logs for all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application logs retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppLogsResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Get application backup

> Generates and retrieves backup for a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppBackupResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"backups":{"oneOf":[{"$ref":"#/components/schemas/AppBackup"},{"type":"array","items":{"$ref":"#/components/schemas/AppBackup"}}]}}},"AppBackup":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the application"},"url":{"type":"string","description":"URL to download the application backup"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/backup":{"get":{"tags":["Applications"],"summary":"Get application backup","description":"Generates and retrieves backup for a specific application or all applications","operationId":"getAppBackup","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to retrieve backups for all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application backup generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppBackupResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Start application

> Starts a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppStartResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"},"appStatus":{"$ref":"#/components/schemas/AppStartStatus"}}},"AppStartStatus":{"type":"object","properties":{"online":{"type":"boolean","description":"Whether the application is online"},"ramKilled":{"type":"boolean","description":"Whether the application was terminated due to RAM issues"},"exitCode":{"type":"integer","description":"The exit code of the application process"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/start":{"put":{"tags":["Applications"],"summary":"Start application","description":"Starts a specific application or all applications","operationId":"startApp","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to start all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStartResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Restart application

> Restarts a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppRestartResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/restart":{"put":{"tags":["Applications"],"summary":"Restart application","description":"Restarts a specific application or all applications","operationId":"restartApp","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to restart all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application restarted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRestartResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Stop application

> Stops a specific application or all applications

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppStopResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/stop":{"put":{"tags":["Applications"],"summary":"Stop application","description":"Stops a specific application or all applications","operationId":"stopApp","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application or \"all\" to stop all applications","schema":{"type":"string"}}],"responses":{"200":{"description":"Application stop response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppStopResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Update application RAM

> Updates the RAM allocation for a specific application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppRamUpdateRequest":{"type":"object","required":["ramMB"],"properties":{"ramMB":{"type":"integer","description":"The amount of RAM in MB to allocate to the application"}}},"AppRamUpdateResponse":{"type":"object","properties":{"status":{"type":"string"},"statusCode":{"type":"integer"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/ram":{"put":{"tags":["Applications"],"summary":"Update application RAM","description":"Updates the RAM allocation for a specific application","operationId":"updateAppRam","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application to update RAM for","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRamUpdateRequest"}}}},"responses":{"200":{"description":"RAM update response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppRamUpdateResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found or plan limitation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Update application code

> Updates an existing application by uploading a new version of the code

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/commit":{"put":{"tags":["Applications"],"summary":"Update application code","description":"Updates an existing application by uploading a new version of the code","operationId":"commitAppChanges","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application to update","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Application file to upload (.ZIP format)"}}}}}},"responses":{"200":{"description":"Commit response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```

## Update application profile

> Updates the profile information (avatar and name) for a specific application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppProfileUpdateRequest":{"type":"object","required":["avatarURL","name"],"properties":{"avatarURL":{"type":"string","description":"URL to the application's avatar image"},"name":{"type":"string","description":"Name of the application"}}},"AppProfileUpdateResponse":{"type":"object","properties":{"status":{"type":"string"},"statusCode":{"type":"integer"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/profile":{"put":{"tags":["Applications"],"summary":"Update application profile","description":"Updates the profile information (avatar and name) for a specific application","operationId":"updateAppProfile","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application to update profile for","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppProfileUpdateRequest"}}}},"responses":{"200":{"description":"Profile updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppProfileUpdateResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}
```

## List files and directories

> List files and directories in the application's directory

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"ExplorerListResponse":{"properties":{"status":{"type":"string"},"path":{"type":"string","description":"Current directory path"},"dir":{"type":"array","items":{"$ref":"#/components/schemas/FileItem"}}},"type":"object"},"FileItem":{"type":"object","properties":{"size":{"type":"integer","description":"File size in bytes (only for files)"},"name":{"type":"string","description":"File or directory name"},"type":{"enum":["file","directory"],"description":"Type of item","type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/explorer":{"get":{"tags":["Applications"],"summary":"List files and directories","description":"List files and directories in the application's directory","operationId":"listExplorer","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application","schema":{"type":"string"}},{"name":"cPath","in":"query","required":false,"description":"Directory path (defaults to app workDir)","schema":{"type":"string"}}],"responses":{"200":{"description":"Files and directories listed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerListResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or insufficient plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found or invalid path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create file or directory

> Create a new file or directory in the application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"ExplorerCreateRequest":{"properties":{"typeFile":{"enum":["file","directory"],"description":"Type to create","type":"string"},"cPath":{"type":"string","description":"Full path for new file or directory"}},"type":"object","required":["cPath","typeFile"]},"ExplorerOperationResponse":{"properties":{"status":{"type":"string"},"path":{"type":"string","description":"Operation target path"}},"type":"object"},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/explorer":{"post":{"tags":["Applications"],"summary":"Create file or directory","description":"Create a new file or directory in the application","operationId":"createExplorer","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerCreateRequest"}}}},"responses":{"200":{"description":"File or directory created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerOperationResponse"}}}},"400":{"description":"Bad request - missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or insufficient plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found or invalid path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Open/read file

> Read the contents of a file in the application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"ExplorerOpenResponse":{"properties":{"status":{"type":"string"},"path":{"type":"string","description":"Full file path"},"name":{"type":"string","description":"File name"},"content":{"type":"string","description":"File content"},"message":{"type":"string"}},"type":"object"},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/explorer/open":{"get":{"tags":["Applications"],"summary":"Open/read file","description":"Read the contents of a file in the application","operationId":"openExplorer","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application","schema":{"type":"string"}},{"name":"cPath","in":"query","required":true,"description":"Full file path","schema":{"type":"string"}}],"responses":{"200":{"description":"File opened successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerOpenResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or insufficient plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"File not found or invalid path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Edit file

> Edit the contents of a file in the application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"ExplorerEditRequest":{"properties":{"fileContent":{"type":"string","description":"New file content"},"cPath":{"type":"string","description":"Full file path"}},"type":"object","required":["cPath","fileContent"]},"ExplorerOperationResponse":{"properties":{"status":{"type":"string"},"path":{"type":"string","description":"Operation target path"}},"type":"object"},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/explorer/edit":{"put":{"tags":["Applications"],"summary":"Edit file","description":"Edit the contents of a file in the application","operationId":"editExplorer","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerEditRequest"}}}},"responses":{"200":{"description":"File edited successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplorerOperationResponse"}}}},"400":{"description":"Bad request - missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or insufficient plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"File not found or invalid path","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Execute command in container

> Execute a command inside the application container

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"ExecRequest":{"properties":{"cmd":{"type":"string","description":"Command to execute in the container"}},"type":"object","required":["cmd"]},"ExecResponse":{"properties":{"status":{"type":"string"},"statusCode":{"type":"integer"},"message":{"type":"string"},"exec":{"oneOf":[{"$ref":"#/components/schemas/ExecOutput"},{"type":"object","nullable":true}]}},"type":"object"},"ExecOutput":{"properties":{"stdout":{"type":"string","description":"Standard output from the command"},"stderr":{"type":"string","description":"Standard error from the command"},"exitCode":{"type":"integer","description":"Exit code of the command"}},"type":"object"},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/exec":{"put":{"tags":["Applications"],"summary":"Execute command in container","description":"Execute a command inside the application container","operationId":"execCommand","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecRequest"}}}},"responses":{"200":{"description":"Command executed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission - only app owner can execute commands","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found or offline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecResponse"}}}}}}}}}
```

## Delete application

> Permanently deletes an application

```json
{"openapi":"3.0.4","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Applications","description":"Operations about applications"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"AppDeleteResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}},"UploadErrorResponse":{"type":"object","properties":{"status":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/app/{appID}/delete":{"delete":{"tags":["Applications"],"summary":"Delete application","description":"Permanently deletes an application","operationId":"deleteApp","parameters":[{"name":"appID","in":"path","required":true,"description":"ID of the application to delete","schema":{"type":"string"}}],"responses":{"200":{"description":"Application deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppDeleteResponse"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Application not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadErrorResponse"}}}}}}}}}
```
