{
    "openapi": "3.0.0",
    "info": {
        "title": "Backend API Documentation",
        "description": "Backend API documentation",
        "version": "1.0.0"
    },
    "paths": {
        "/api/login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Login and send OTP",
                "description": "Authenticates the user and sends a one-time password to the registered email address.",
                "operationId": "apiLogin",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "password"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "OTP sent successfully."
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid credentials"
                    },
                    "403": {
                        "description": "Account deactivated"
                    },
                    "500": {
                        "description": "Unable to send OTP email"
                    }
                }
            }
        },
        "/api/verify-otp": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Verify OTP",
                "description": "Verifies the OTP and returns the API authentication token.",
                "operationId": "verifyOtpApi",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_id",
                                    "otp"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "otp": {
                                        "type": "string",
                                        "example": "123456"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP verified successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "OTP Verified Successfully."
                                        },
                                        "token": {
                                            "type": "string",
                                            "example": "xxxxxxxxxxxxxxxxxxxxxxxx"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid or expired OTP"
                    }
                }
            }
        },
        "/api/dashboard": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Get dashboard",
                "operationId": "apiDashboard",
                "responses": {
                    "200": {
                        "description": "Dashboard data"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Get authenticated user",
                "operationId": "getAuthenticatedUser",
                "responses": {
                    "200": {
                        "description": "Authenticated user"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/logout": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Logout",
                "operationId": "apiLogout",
                "responses": {
                    "200": {
                        "description": "Logout successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Logout Successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/test": {
            "get": {
                "tags": [
                    "Test"
                ],
                "summary": "Test API",
                "operationId": "ba735c0b9a845aa800e3f6b089f0e2a0",
                "responses": {
                    "200": {
                        "description": "Successful response"
                    }
                }
            }
        }
    },
    "tags": [
        {
            "name": "Authentication",
            "description": "Authentication"
        },
        {
            "name": "Test",
            "description": "Test"
        }
    ]
}