{ "swagger": "2.0", "info": { "description": "Cloud file storage server with Backblaze B2 integration", "title": "Anexis Cloud Storage API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "email": "support@gurren-software.com" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "1.0" }, "host": "localhost:8080", "basePath": "/", "paths": { "/api/v1/auth/login": { "post": { "description": "Authenticate user and get tokens", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login user", "parameters": [ { "description": "Login credentials", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/auth.TokenResponse" } } } ] } } } } }, "/api/v1/auth/me": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get current authenticated user profile", "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Get current user", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/auth.UserResponse" } } } ] } } } } }, "/api/v1/auth/password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Change current user password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Change password", "parameters": [ { "description": "Password change details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ChangePasswordRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/v1/auth/refresh": { "post": { "description": "Get new access token using refresh token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Refresh token", "parameters": [ { "description": "Refresh token", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.RefreshTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/auth.TokenResponse" } } } ] } } } } }, "/api/v1/auth/register": { "post": { "description": "Register a new user account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Register new user", "parameters": [ { "description": "Registration details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.RegisterRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/auth.UserResponse" } } } ] } } } } }, "/api/v1/backup": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List user's backup jobs", "produces": [ "application/json" ], "tags": [ "backup" ], "summary": "List backup jobs", "parameters": [ { "type": "string", "description": "Filter by type (export/import)", "name": "type", "in": "query" }, { "type": "string", "description": "Filter by status", "name": "status", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "Items per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/v1/backup/export": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Start exporting all user data to a backup archive", "produces": [ "application/json" ], "tags": [ "backup" ], "summary": "Start backup export", "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/backup.BackupResponse" } } } ] } } } } }, "/api/v1/backup/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get details of a backup job", "produces": [ "application/json" ], "tags": [ "backup" ], "summary": "Get backup job", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/backup.BackupResponse" } } } ] } } } } }, "/api/v1/backup/{id}/download": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get download URL for a completed backup", "produces": [ "application/json" ], "tags": [ "backup" ], "summary": "Download backup", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/v1/files": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List files with pagination", "produces": [ "application/json" ], "tags": [ "files" ], "summary": "List files", "parameters": [ { "type": "string", "description": "Parent folder ID", "name": "parent_id", "in": "query" }, { "type": "string", "description": "Search term", "name": "search", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "Items per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileListResponse" } } } ] } } } } }, "/api/v1/files/folder": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new folder", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Create folder", "parameters": [ { "description": "Folder details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/files.CreateFolderRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileResponse" } } } ] } } } } }, "/api/v1/files/upload": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a new file", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Upload file", "parameters": [ { "type": "file", "description": "File to upload", "name": "file", "in": "formData", "required": true }, { "type": "boolean", "description": "Compress file", "name": "compress", "in": "formData" }, { "type": "string", "description": "Parent folder ID", "name": "parent_id", "in": "formData" }, { "type": "string", "description": "File description", "name": "description", "in": "formData" } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileResponse" } } } ] } } } } }, "/api/v1/files/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get file metadata", "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Get file details", "parameters": [ { "type": "string", "description": "File ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileResponse" } } } ] } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a file or folder", "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Delete file/folder", "parameters": [ { "type": "string", "description": "File ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/api/v1/files/{id}/download": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Download a file", "produces": [ "application/octet-stream" ], "tags": [ "files" ], "summary": "Download file", "parameters": [ { "type": "string", "description": "File ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/api/v1/files/{id}/move": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Move a file or folder", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Move file/folder", "parameters": [ { "type": "string", "description": "File ID", "name": "id", "in": "path", "required": true }, { "description": "New parent", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/files.MoveRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileResponse" } } } ] } } } } }, "/api/v1/files/{id}/rename": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Rename a file or folder", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Rename file/folder", "parameters": [ { "type": "string", "description": "File ID", "name": "id", "in": "path", "required": true }, { "description": "New name", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/files.RenameRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/files.FileResponse" } } } ] } } } } }, "/api/v1/links": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List user's access links", "produces": [ "application/json" ], "tags": [ "links" ], "summary": "List links", "parameters": [ { "type": "string", "description": "Filter by file ID", "name": "file_id", "in": "query" }, { "type": "string", "description": "Filter by link type", "name": "type", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "Items per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new access link for a file", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "links" ], "summary": "Create access link", "parameters": [ { "description": "Link details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/links.CreateLinkRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/links.LinkResponse" } } } ] } } } } }, "/api/v1/links/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an access link", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "links" ], "summary": "Update link", "parameters": [ { "type": "string", "description": "Link ID", "name": "id", "in": "path", "required": true }, { "description": "Updated link details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/links.UpdateLinkRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/links.LinkResponse" } } } ] } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete an access link", "produces": [ "application/json" ], "tags": [ "links" ], "summary": "Delete link", "parameters": [ { "type": "string", "description": "Link ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/api/v1/links/{token}/access": { "get": { "description": "Download a file using an access link", "produces": [ "application/octet-stream" ], "tags": [ "links" ], "summary": "Access file via link", "parameters": [ { "type": "string", "description": "Link token", "name": "token", "in": "path", "required": true }, { "type": "string", "description": "Password (if protected)", "name": "password", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/api/v1/links/{token}/stream": { "get": { "description": "Get a streaming URL for a file", "produces": [ "application/json" ], "tags": [ "links" ], "summary": "Get streaming URL", "parameters": [ { "type": "string", "description": "Link token", "name": "token", "in": "path", "required": true }, { "type": "string", "description": "Password (if protected)", "name": "password", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } }, "/api/v1/migration": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List user's migration jobs", "produces": [ "application/json" ], "tags": [ "migration" ], "summary": "List migration jobs", "parameters": [ { "type": "string", "description": "Filter by status", "name": "status", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "Items per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Start a new migration job from external provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "migration" ], "summary": "Start migration", "parameters": [ { "description": "Migration details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/migration.StartMigrationRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/migration.MigrationResponse" } } } ] } } } } }, "/api/v1/migration/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get details of a migration job", "produces": [ "application/json" ], "tags": [ "migration" ], "summary": "Get migration job", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/migration.MigrationResponse" } } } ] } } } } }, "/api/v1/migration/{id}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Cancel a running migration job", "produces": [ "application/json" ], "tags": [ "migration" ], "summary": "Cancel migration", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/response.Response" } } } } } }, "definitions": { "auth.ChangePasswordRequest": { "type": "object", "required": [ "current_password", "new_password" ], "properties": { "current_password": { "type": "string" }, "new_password": { "type": "string", "minLength": 8 } } }, "auth.LoginRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "auth.RefreshTokenRequest": { "type": "object", "required": [ "refresh_token" ], "properties": { "refresh_token": { "type": "string" } } }, "auth.RegisterRequest": { "type": "object", "required": [ "email", "name", "password" ], "properties": { "email": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 }, "password": { "type": "string", "minLength": 8 } } }, "auth.TokenResponse": { "type": "object", "properties": { "access_token": { "type": "string" }, "expires_in": { "description": "seconds until expiration", "type": "integer" }, "refresh_token": { "type": "string" }, "token_type": { "type": "string" } } }, "auth.UserResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "storage_quota": { "type": "integer" }, "storage_used": { "type": "integer" } } }, "backup.BackupResponse": { "type": "object", "properties": { "archive_key": { "type": "string" }, "archive_size": { "type": "integer" }, "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "download_url": { "type": "string" }, "expires_at": { "type": "string" }, "id": { "type": "string" }, "last_error": { "type": "string" }, "processed_files": { "type": "integer" }, "progress": { "type": "number" }, "started_at": { "type": "string" }, "status": { "type": "string" }, "total_files": { "type": "integer" }, "type": { "type": "string" } } }, "files.CreateFolderRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "maxLength": 255, "minLength": 1 }, "parent_id": { "type": "string" } } }, "files.FileListResponse": { "type": "object", "properties": { "files": { "type": "array", "items": { "$ref": "#/definitions/files.FileResponse" } }, "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total_count": { "type": "integer" } } }, "files.FileResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "is_compressed": { "type": "boolean" }, "is_encrypted": { "type": "boolean" }, "is_folder": { "type": "boolean" }, "mime_type": { "type": "string" }, "name": { "type": "string" }, "original_name": { "type": "string" }, "parent_id": { "type": "string" }, "size": { "type": "integer" }, "updated_at": { "type": "string" } } }, "files.MoveRequest": { "type": "object", "properties": { "parent_id": { "type": "string" } } }, "files.RenameRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "maxLength": 255, "minLength": 1 } } }, "links.CreateLinkRequest": { "type": "object", "required": [ "file_id", "type" ], "properties": { "access_type": { "type": "string", "enum": [ "public", "private", "restricted" ] }, "description": { "type": "string" }, "expires_in": { "description": "seconds until expiration", "type": "integer" }, "file_id": { "type": "string" }, "max_downloads": { "type": "integer" }, "name": { "type": "string" }, "password": { "type": "string" }, "type": { "type": "string", "enum": [ "download", "stream", "permanent", "temporal" ] } } }, "links.LinkResponse": { "type": "object", "properties": { "access_type": { "type": "string" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "download_count": { "type": "integer" }, "expires_at": { "type": "string" }, "file_id": { "type": "string" }, "file_name": { "type": "string" }, "id": { "type": "string" }, "last_accessed_at": { "type": "string" }, "max_downloads": { "type": "integer" }, "name": { "type": "string" }, "token": { "type": "string" }, "type": { "type": "string" }, "url": { "type": "string" } } }, "links.UpdateLinkRequest": { "type": "object", "properties": { "description": { "type": "string" }, "expires_in": { "description": "seconds to extend", "type": "integer" }, "max_downloads": { "type": "integer" }, "name": { "type": "string" }, "password": { "type": "string" } } }, "migration.MigrationResponse": { "type": "object", "properties": { "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "failed_files": { "type": "integer" }, "id": { "type": "string" }, "last_error": { "type": "string" }, "processed_bytes": { "type": "integer" }, "processed_files": { "type": "integer" }, "progress": { "type": "number" }, "provider": { "type": "string" }, "started_at": { "type": "string" }, "status": { "type": "string" }, "total_bytes": { "type": "integer" }, "total_files": { "type": "integer" } } }, "migration.StartMigrationRequest": { "type": "object", "required": [ "access_token", "provider" ], "properties": { "access_token": { "type": "string" }, "provider": { "type": "string", "enum": [ "google", "amazon", "microsoft", "dropbox" ] }, "refresh_token": { "type": "string" } } }, "response.ErrorInfo": { "type": "object", "properties": { "code": { "type": "string" }, "details": { "type": "string" }, "message": { "type": "string" } } }, "response.Meta": { "type": "object", "properties": { "page": { "type": "integer" }, "per_page": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "response.Response": { "type": "object", "properties": { "data": {}, "error": { "$ref": "#/definitions/response.ErrorInfo" }, "meta": { "$ref": "#/definitions/response.Meta" }, "success": { "type": "boolean" } } } }, "securityDefinitions": { "BearerAuth": { "description": "Enter your bearer token in the format: Bearer {token}", "type": "apiKey", "name": "Authorization", "in": "header" } } }