mirror of
https://github.com/wizarrrr/wizarr.git
synced 2025-12-23 23:59:23 -05:00
✅ Replaced manual API documentation with Flask-RESTX OpenAPI generation ✅ All endpoints now auto-generate Swagger UI at /api/docs/ ✅ Maintained backward compatibility - all existing API functionality preserved ✅ Added comprehensive OpenAPI models for request/response validation Changes: - app/blueprints/api/api_routes.py: Migrated from Flask routes to Flask-RESTX Resource classes - app/blueprints/api/models.py: Created OpenAPI schema definitions - app/extensions.py: Added Flask-RESTX configuration with API key security - pyproject.toml: Added flask-restx>=1.3.0 dependency - README.md: Updated API documentation to point to interactive Swagger UI - docs/API.md: Simplified to quick-start guide pointing to automatic docs
2.1 KiB
2.1 KiB
Wizarr API Documentation
Wizarr provides a comprehensive REST API with automatic OpenAPI/Swagger documentation.
Interactive Documentation
- 📖 Swagger UI:
http://your-wizarr-instance/api/docs/ - 📋 OpenAPI Spec:
http://your-wizarr-instance/api/swagger.json
The interactive documentation provides:
- Real-time API testing interface
- Complete request/response schemas
- Authentication examples
- Error code explanations
Quick Start
Authentication
All API endpoints require authentication using an API key:
curl -H "X-API-Key: your_api_key_here" \
http://your-wizarr-instance/api/status
API Key Management
- Log into your Wizarr web interface
- Navigate to Settings → API Keys
- Click "Create API Key"
- Copy the generated key (shown only once)
Available Endpoints
The API is organized into the following sections:
- Status: System statistics
- Users: User management across media servers
- Invitations: Invitation creation and management
- Libraries: Media library information
- Servers: Configured media server details
- API Keys: API key management
Example Usage
import requests
API_KEY = "your_api_key_here"
BASE_URL = "http://your-wizarr-instance/api"
headers = {"X-API-Key": API_KEY}
# Get system status
response = requests.get(f"{BASE_URL}/status", headers=headers)
print(response.json())
# Create invitation
data = {
"server_ids": [1],
"expires_in_days": 7,
"duration": "30",
"unlimited": False
}
response = requests.post(
f"{BASE_URL}/invitations",
headers={**headers, "Content-Type": "application/json"},
json=data
)
if response.status_code == 201:
invitation = response.json()
print(f"Invitation URL: {invitation['invitation']['url']}")
Interactive Testing
Visit /api/docs/ on your Wizarr instance to:
- Browse all available endpoints
- Test API calls directly in your browser
- View detailed request/response examples
- Download the OpenAPI specification
The Swagger UI provides the most up-to-date and complete API documentation.