Complete API reference for the Flask AWS Backend application.
http://localhost:5000/api/v1 (Development)
https://api.example.com/api/v1 (Production)
Most endpoints require authentication using JWT (JSON Web Tokens).
Authorization: Bearer <access_token>
Content-Type: application/json
All API responses follow a consistent format:
{
"success": true,
"message": "Operation successful",
"data": { ... }
}{
"success": false,
"message": "Error message",
"errors": { ... }
}{
"success": true,
"message": "Success",
"data": [ ... ],
"pagination": {
"page": 1,
"per_page": 10,
"total": 100,
"total_pages": 10,
"has_next": true,
"has_prev": false
}
}Basic health check endpoint.
Response
{
"success": true,
"message": "Application is running",
"data": {
"status": "healthy",
"version": "1.0.0"
}
}Detailed health check including database and cache status.
Response
{
"success": true,
"message": "All systems operational",
"data": {
"application": "healthy",
"database": "healthy",
"cache": "healthy"
}
}Register a new user account.
Request Body
{
"email": "user@example.com",
"username": "username",
"password": "password123"
}Response (201 Created)
{
"success": true,
"message": "User registered successfully",
"data": {
"user": {
"id": 1,
"email": "user@example.com",
"username": "username",
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
},
"access_token": "eyJ0eXAiOiJKV1QiLCJhbG...",
"refresh_token": "eyJ0eXAiOiJKV1QiLCJhbG..."
}
}Authenticate user and receive access tokens.
Request Body
{
"email": "user@example.com",
"password": "password123"
}Response (200 OK)
{
"success": true,
"message": "Login successful",
"data": {
"user": { ... },
"access_token": "eyJ0eXAiOiJKV1QiLCJhbG...",
"refresh_token": "eyJ0eXAiOiJKV1QiLCJhbG..."
}
}Refresh access token using refresh token.
Headers
Authorization: Bearer <refresh_token>
Response (200 OK)
{
"success": true,
"message": "Token refreshed successfully",
"data": {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbG..."
}
}Get current authenticated user profile.
Headers
Authorization: Bearer <access_token>
Response (200 OK)
{
"success": true,
"message": "User profile retrieved",
"data": {
"id": 1,
"email": "user@example.com",
"username": "username",
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}Update current user profile.
Headers
Authorization: Bearer <access_token>
Request Body
{
"username": "new_username"
}Response (200 OK)
{
"success": true,
"message": "User profile updated successfully",
"data": { ... }
}Get paginated list of items.
Headers
Authorization: Bearer <access_token>
Query Parameters
page(integer, default: 1) - Page numberper_page(integer, default: 10, max: 100) - Items per page
Response (200 OK)
{
"success": true,
"message": "Success",
"data": [
{
"id": 1,
"name": "Item Name",
"description": "Item description",
"price": 99.99,
"user_id": 1,
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
],
"pagination": { ... }
}Get a specific item by ID.
Headers
Authorization: Bearer <access_token>
Response (200 OK)
{
"success": true,
"data": {
"id": 1,
"name": "Item Name",
"description": "Item description",
"price": 99.99,
"user_id": 1,
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}Create a new item.
Headers
Authorization: Bearer <access_token>
Request Body
{
"name": "Item Name",
"description": "Item description",
"price": 99.99
}Response (201 Created)
{
"success": true,
"message": "Item created successfully",
"data": { ... }
}Update an existing item.
Headers
Authorization: Bearer <access_token>
Request Body
{
"name": "Updated Name",
"description": "Updated description",
"price": 149.99
}Response (200 OK)
{
"success": true,
"message": "Item updated successfully",
"data": { ... }
}Delete an item.
Headers
Authorization: Bearer <access_token>
Response (204 No Content)
{
"success": true,
"message": "Item deleted successfully"
}| Status Code | Description |
|---|---|
| 200 | OK - Request successful |
| 201 | Created - Resource created |
| 204 | No Content - Successful deletion |
| 400 | Bad Request - Invalid request data |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource not found |
| 409 | Conflict - Resource already exists |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error |
| 503 | Service Unavailable - Service temporarily unavailable |
API endpoints are rate limited to prevent abuse:
- Default: 100 requests per hour per IP
- Authenticated: 1000 requests per hour per user
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000