LayoodStorage API Documentation

🚀 LayoodStorage API

Complete S3-Native Cloud Storage Platform API

World's First S3-Powered Consumer Storage with WhatsApp Authentication

Development: http://localhost:5050/api
Production: https://api.layoodstorage.com/api
59
Total Endpoints
Production Ready
Zata.ai S3
Enterprise Storage
🇮🇳
WhatsApp Auth
AiSensy Integration
📱
Auto-Backup
Mobile Native

🔐 Authentication Endpoints

WhatsApp OTP-based authentication system with dual role support (Admin/Client)

1. Login with WhatsApp OTP
Send OTP to user's WhatsApp via AiSensy
POST
2. Verify OTP & Complete Login
Verify OTP and get JWT token
POST

3. Resend OTP

POST /api/resend-otp

Resend OTP if not received

4. Check Session

GET /api/session/check

Validate current session

5. Extend Session

POST /api/session/extend

Extend session validity

6. Logout

POST /api/logout

Clear session & logout

📊 Dashboard Endpoints

Role-based dashboard access with statistics and analytics

🔐 Admin Dashboard

GET /api/dashboard/admin

Headers: Authorization: Bearer {token}

Access: Admin only

Returns: System stats, user management, file analytics

👤 Client Dashboard

GET /api/dashboard/client

Headers: Authorization: Bearer {token}

Access: Client only

Returns: Personal stats, storage usage, recent files

📁 File Management Endpoints

S3-native file operations with Zata.ai integration and real-time progress tracking

📤 Upload File (S3-Native)
Upload files directly to Zata.ai S3 with progress tracking
POST

📂 List Files

GET /api/files/list

Get all user files with metadata

⬇️ Download File

GET /api/files/{id}/download

Stream file from S3 storage

🗑️ Delete File

DELETE /api/files/{id}/delete

Remove from S3 and update storage

🔍 Search Files

GET /api/search?q=query

Search files by name or type

🔗 Share File

POST /api/files/{id}/share

Generate public share link

📊 File Info

GET /api/files/{id}/info

Get detailed file metadata

📂 Folder Management

Organize files with hierarchical folder structure

📁 Create Folder

POST /api/folders/create

Create new folder with optional parent

📋 List Folders

GET /api/folders/list

Get folder tree structure

🗑️ Delete Folder

DELETE /api/folders/{id}/delete

Delete folder and all contents

📱 Auto-Backup System

Mobile device backup with session tracking and progress monitoring

📱 Register Device

POST /api/devices/register

Register device for auto-backup

🚀 Start Backup

POST /api/backup/start

Initiate backup session with progress tracking

⬆️ Upload to Session

POST /api/backup/upload

Upload files with session tracking

👥 Backup Contacts

POST /api/backup/contacts

Special endpoint for contacts backup

📊 Backup Analytics

GET /api/backup/analytics

Get backup statistics and progress

📋 Session Logs

GET /api/backup/session/{id}/logs

Detailed logs for backup session

✅ Complete Session

POST /api/backup/complete

Mark backup session as completed

⚙️ Device Settings

PUT /api/devices/{id}/settings

Update backup preferences

🎬 File Preview System

Auto-generated thumbnails for videos, images, and documents

🎯 Generate Preview

POST /api/files/{id}/generate-preview

Generate thumbnail for specific file

🖼️ Get Preview

GET /api/files/{id}/preview/{type}

Download preview image

📊 Preview Info

GET /api/files/{id}/preview-info

Get preview metadata

⚡ Batch Generate

POST /api/files/batch-generate-previews

Generate previews for multiple files

📋 Supported File Types for Previews

🎥 Videos

• MP4, AVI, MOV
• MKV, WebM
• Auto thumbnail at 3s

🖼️ Images

• JPEG, PNG, GIF
• BMP, WebP, SVG
• Auto-rotate EXIF

📄 Documents

• PDF (first page)
• Text files
• CSV files

💻 Bulk Upload System

PC/Web folder upload with progress tracking

🚀 Start Session

POST /api/bulk-upload/start

Initialize bulk upload session

📁 Upload File

POST /api/bulk-upload/file

Upload with folder structure

✅ Complete

POST /api/bulk-upload/complete

Finalize bulk upload session

💳 Payment System

Razorpay integration for subscription management

💰 Storage Plans

GET /api/storage-plans

Get available subscription plans

🛒 Create Order

POST /api/create-order

Create Razorpay payment order

✅ Verify Payment

POST /api/verify-payment

Verify and activate subscription

📜 Payment History

GET /api/payments/history

Get user payment transactions

📊 Subscription Status

GET /api/subscription/status

Current subscription details

🔔 Webhook

POST /api/razorpay/webhook

Handle payment status updates

📈 Analytics Endpoints

Usage analytics and statistics for users and admins

📊 Usage Analytics

GET /api/analytics/usage

Storage usage and file statistics

📈 User Storage Stats

GET /api/user/storage-stats

Detailed storage statistics

👤 User Folder Info

GET /api/user/folder-info

User's Zata.ai folder information

🔐 Admin-Only Endpoints

Administrative functions for system management

👥 List All Users

GET /api/admin/users

Get all users with details

💾 Update Storage

PUT /api/admin/users/{id}/storage

Modify user storage quotas

📊 System Stats

GET /api/admin/system/stats

Overall system health and stats

📈 Storage Analytics

GET /api/admin/storage-analytics

System-wide storage analytics

🔄 Backup Overview

GET /api/admin/backup/overview

System backup statistics

🎬 Preview Analytics

GET /api/admin/preview-analytics

Thumbnail generation statistics

💳 Create Plan

POST /api/admin/plans/create

Add new subscription plans

🚀 Frontend Integration Guide

🔐 Authentication Flow

  1. 1 Call /api/login with phone number
  2. 2 User receives WhatsApp OTP via AiSensy
  3. 3 Call /api/verify-otp with OTP
  4. 4 Store JWT token for authenticated requests
  5. 5 Use Authorization: Bearer <token> header

📁 File Upload Process

  1. 1 Check user storage quota first
  2. 2 Upload to /api/files/upload
  3. 3 Show real-time progress if supported
  4. 4 Handle success/error responses
  5. 5 Update UI with new file data

📱 Auto-Backup Flow

  1. 1 Register device with /api/devices/register
  2. 2 Start backup session
  3. 3 Upload files with session tracking
  4. 4 Show real-time progress
  5. 5 Complete session when done

💳 Payment Integration

  1. 1 Show plans from /api/storage-plans
  2. 2 Create Razorpay order
  3. 3 Handle Razorpay payment UI
  4. 4 Verify payment on backend
  5. 5 Update user subscription status

🌟 Zata.ai S3 Advantages

Enterprise Reliability
99.999999999% durability (11 9's)
Unlimited Scale
No storage limits, grows with users
Global Performance
CDN-powered worldwide access
Real-time Progress
Session-based upload tracking

⚠️ Important Implementation Notes

  • JWT Tokens expire in 24 hours - Handle token refresh gracefully
  • File uploads support progress tracking - Show real-time feedback to users
  • WhatsApp OTP is unique advantage - Highlight this feature prominently
  • Razorpay supports all Indian payments - UPI, Cards, NetBanking, Wallets
  • Auto-backup requires device registration - Guide users through setup process
  • Thumbnails auto-generate - Handle loading states for previews

⚠️ Error Codes & Responses

🔐 Authentication Errors

401 - NO_TOKEN: Authentication required
401 - INVALID_TOKEN: Token expired/invalid
403 - INSUFFICIENT_ROLE: Access denied
404 - USER_INACTIVE: User not found/inactive

📁 File Operation Errors

413 - Storage quota exceeded
413 - File too large (>100MB)
404 - File not found
500 - S3 upload/download failed

💳 Payment Errors

400 - Invalid payment request
400 - Payment verification failed
503 - Payment service unavailable
404 - Plan not found

📱 Backup Errors

404 - Device not found
403 - Backup disabled
404 - Session not found/expired
429 - Too many attempts

⏱️ Rate Limits & Constraints

🔐 Authentication

OTP Requests: 1/min per phone
OTP Attempts: 3 per session
Session Duration: 24 hours

📁 File Operations

Max File Size: 100 MB
Concurrent Uploads: 5 per user
API Calls: 1000/hour

📱 Auto-Backup

Session Duration: 6 hours max
Files per Session: 10,000 max
Active Sessions: 3 per device

🛠️ SDKs & Integration Libraries

📱 Mobile SDKs

React Native
Full featured SDK with auto-backup
npm install layood-storage-rn
iOS Swift
Native iOS integration
pod 'LayoodStorage'
Android Kotlin
Native Android integration
implementation 'com.layood:storage:1.0.0'

🌐 Web SDKs

JavaScript/TypeScript
Browser and Node.js support
npm install layood-storage-js
React Components
Pre-built UI components
npm install @layood/react-components
Vue.js Plugin
Vue 3 integration plugin
npm install @layood/vue-storage

🚀 Ready to Build the Future?

Your S3-native backend is ready for a world-class frontend!

59 Endpoints
Production Ready
S3-Native
Zata.ai Powered
India First
WhatsApp + Razorpay
Enterprise Ready
Scale to Millions

🔗 Quick Links

Admin Access
Phone: +919557340005
Type: admin
Test Client
Phone: +918108102328
Type: client
Storage Plans
Free: 5GB | Premium: 500GB
Business: 2TB

LayoodStorage API v1.0.1 - The most complete cloud storage API platform

Built with ❤️ for the next generation of cloud storage