{"openapi":"3.0.3","info":{"title":"SendPulse FileManager Public API","description":"Using the API for the FileManager service, you can integrate your system with FileManager from SendPulse","version":"1.0.0"},"servers":[{"url":"https:\/\/api.sendpulse.com\/fm\/public\/v1","description":"Production server"}],"tags":[{"name":"File","description":"file entity"},{"name":"Directory","description":"directory entity"}],"paths":{"\/file":{"post":{"tags":["File"],"summary":"Upload file to storage","description":"Uploads one or multiple files to the specified directory","requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["content[]","pathToStore"],"properties":{"content[]":{"type":"array","items":{"type":"string","format":"binary"},"description":"File(s) to upload"},"pathToStore":{"type":"string","example":"\/test","description":"Path to the directory where the file will be stored"},"height":{"type":"integer","description":"Optional height parameter for video files","example":1080},"width":{"type":"integer","description":"Optional width parameter for video files","example":1920}}}}}},"responses":{"200":{"description":"File successfully uploaded","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}},"delete":{"tags":["File"],"summary":"Delete file from storage","description":"Delete specific file from storage","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path to file in storage","example":"\/directory\/file_name.txt"}}}}}},"responses":{"204":{"description":"File delete successfully"},"404":{"description":"File not found"}}}},"\/file\/exist":{"post":{"tags":["File"],"summary":"Check if file exists","description":"Checks whether a file exists at the specified path","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string","example":"\/test\/file.txt","description":"Path to the file to check"}}}}}},"responses":{"200":{"description":"Check completed successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","description":"Whether the file exists"}}}}}}}}},"\/directory":{"post":{"tags":["Directory"],"summary":"Create directory","description":"Creates a new directory at the specified path","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["pathToStore","name"],"properties":{"pathToStore":{"type":"string","example":"\/test","description":"Path where the directory will be created"},"name":{"type":"string","example":"my-folder","description":"Name of the directory to create"}}}}}},"responses":{"200":{"description":"Directory successfully created","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}}}},"get":{"tags":["Directory"],"summary":"Get directory tree","description":"Returns tree structure of directories","responses":{"200":{"description":"Directory tree retrieved successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"tree":{"type":"object","description":"Tree structure of directories"}}}}}}}}},"\/directory\/size":{"get":{"tags":["Directory"],"summary":"Get storage statistics","description":"Returns storage usage statistics","responses":{"200":{"description":"Storage statistics retrieved successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"fileCount":{"type":"integer","description":"Number of files","example":150},"directoryCount":{"type":"integer","description":"Number of directories","example":25},"usedSpace":{"type":"number","format":"float","description":"Used space in MB","example":245.7},"tariffStorageSpace":{"type":"number","format":"float","description":"Available storage space by tariff in MB","example":1024},"availableSpace":{"type":"number","format":"float","description":"Available free space in MB","example":778.3}}}}}}}}},"\/directory\/{path}":{"get":{"tags":["Directory"],"summary":"Get directory contents","description":"Returns data for a specific directory","parameters":[{"in":"path","name":"path","schema":{"type":"string"},"required":true,"description":"Directory path","example":"\/test\/subfolder"}],"responses":{"200":{"description":"Directory contents retrieved successfully","content":{"application\/json":{"schema":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"\/test\/subfolder\/file.txt"},"name":{"type":"string","example":"file.txt"},"isFolder":{"type":"boolean","example":false},"size":{"type":"number","format":"float","example":12.5},"filesCount":{"type":"integer","example":0}}}}}}}}}},"\/directory\/find":{"get":{"tags":["Directory"],"summary":"Search files","description":"Search for files in the specified directory","parameters":[{"in":"query","name":"search","schema":{"type":"string"},"required":true,"description":"Keyword for search","example":"document"},{"in":"query","name":"path","schema":{"type":"string","default":"\/"},"required":true,"description":"Directory for recursive search","example":"\/test"}],"responses":{"200":{"description":"Search results","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"\/test\/document.pdf"},"name":{"type":"string","example":"document.pdf"},"size":{"type":"string","example":2.5},"date":{"type":"string","example":1760529600},"extension":{"type":"string","example":"pdf"},"thumb":{"type":"string","example":"\/thumb\/document.jpg"}}}}}}}}}}}},"\/file\/filter":{"post":{"tags":["File"],"summary":"Filter files","description":"Filters files in the specified directory by date range and sorting","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string","example":"\/test","description":"Directory path to filter files"},"fromDate":{"type":"string","format":"date","nullable":true,"example":"2025-01-01 00:01","description":"Filter files from this date (search: '>='). Supported formats: Y-m-d H:i. Timezone: UTC"},"toDate":{"type":"string","format":"date","nullable":true,"example":"2025-12-31 23:59","description":"Filter files to this date (search: '<='). Supported formats: Y-m-d H:i. Timezone: UTC"},"sort":{"type":"string","nullable":true,"enum":["asc","desc"],"example":"desc","description":"Sort order for files"}}}}}},"responses":{"200":{"description":"Files filtered successfully","content":{"application\/json":{"schema":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","example":"\/test\/test_1.txt","description":"Full path to the file"},"lastModified":{"type":"string","format":"date-time","example":"2025-10-17T14:12:09Z","description":"Last modification timestamp"}}}}}}}}}}},"components":{"responses":{"404":{"description":"Record not found","content":{"application\/json":{"schema":{"properties":{"data":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}}}}}},"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https:\/\/api.sendpulse.com\/oauth\/access_token","scopes":[]}}}}},"security":[{"OAuth2":["read","write"]}]}