{
    "openapi": "3.0.0",
    "info": {
        "title": "Telagus API",
        "version": "1.0.0"
    },
    "paths": {
        "/api/accounts": {
            "get": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Get Facebook account information",
                "operationId": "73324248bea7dc660bd1011c20cd6fb5",
                "responses": {
                    "200": {
                        "description": "Facebook account information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/accounts/authenticate": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Authenticate with Facebook and get access token",
                "operationId": "01410d6aaf1c42af4a8374aa8e380a28",
                "parameters": [
                    {
                        "name": "accessToken",
                        "in": "query",
                        "description": "Facebook access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authentication successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "facebook_access_token": {
                                            "type": "string",
                                            "example": "EAABsbCa6kgMBAJZCZBZA8jH..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication failed"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan": {
            "get": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Get a list of all action plans",
                "operationId": "7de876819c48a7d8399e2a13d7952433",
                "responses": {
                    "200": {
                        "description": "List of action plans retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Create a new action plan",
                "operationId": "7bbe0ee5c8a658357235d46f705916cf",
                "parameters": [
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "Name of the action plan template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "action_plan",
                        "in": "query",
                        "description": "Action plan data (JSON)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "plan_type_id",
                        "in": "query",
                        "description": "ID of the plan type",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "pause_on_reply",
                        "in": "query",
                        "description": "Pause on reply flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "no_sunday_comm",
                        "in": "query",
                        "description": "No Sunday communication flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "notify_completed",
                        "in": "query",
                        "description": "Notify when completed flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the action plan",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "plan": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Action plan campaign create successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-campaign-new-details": {
            "get": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Get campaign details with search functionality",
                "operationId": "5343f9e63521f3892cf14b1d25da08a4",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Search query for campaign name",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan/{id}": {
            "get": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Get details of a specific action plan",
                "operationId": "d813d055aab4454bd93f739474129ef4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the action plan",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "plan": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Action plan not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Update an existing action plan",
                "operationId": "a02e1d1ec2364546cf3603bca1c3a6ee",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the action plan to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "Name of the action plan template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "action_plan",
                        "in": "query",
                        "description": "Action plan data (JSON)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "plan_type_id",
                        "in": "query",
                        "description": "ID of the plan type",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "pause_on_reply",
                        "in": "query",
                        "description": "Pause on reply flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "no_sunday_comm",
                        "in": "query",
                        "description": "No Sunday communication flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "notify_completed",
                        "in": "query",
                        "description": "Notify when completed flag",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the action plan",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Action plan updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Action plan not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Delete an action plan",
                "operationId": "e070e6f1d4d3ffee5585a1e33587a616",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the action plan to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Deleted Successfully."
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Action plan not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/voice-recording": {
            "post": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Upload a voice recording file",
                "operationId": "079448b750f1d3adc7bb0b3071112f76",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Voice recording file to upload (max 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Voice recording uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "file": {
                                            "type": "string",
                                            "example": "https://example.com/recording.mp3"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Upload successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan-clone/{id}": {
            "get": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Clone an existing action plan",
                "operationId": "c4634ac79051663e6340b47c292dafd6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the action plan to clone",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan cloned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Action plan not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/text-to-speech": {
            "post": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Convert text to speech using Elevenlabs API",
                "operationId": "8ea54ef16d58ee3b20ef5841cd34ccee",
                "parameters": [
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Text to convert to speech",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "From phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "audio_name",
                        "in": "query",
                        "description": "Name for the audio file",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "elevenlabs_voice_key",
                        "in": "query",
                        "description": "Elevenlabs voice key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "secret_key",
                        "in": "query",
                        "description": "Elevenlabs API secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description for the MMS",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Text converted to speech successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Media converted and saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-voice-recording": {
            "post": {
                "tags": [
                    "Action Plan"
                ],
                "summary": "Add a voice recording to Elevenlabs",
                "operationId": "38394cbc5003a29d02701ed5dd83242f",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Voice recording file to upload (max 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name for the voice recording",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description for the voice recording",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "accent",
                        "in": "query",
                        "description": "Accent of the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "age",
                        "in": "query",
                        "description": "Age category of the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender of the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "secret_key",
                        "in": "query",
                        "description": "Elevenlabs API secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Voice recording added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Voice has been added successfully."
                                        },
                                        "response": {
                                            "type": "object"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan/{action_plan}": {
            "put": {
                "tags": [
                    "Action Plan Campaign"
                ],
                "summary": "Update an action-plan campaign",
                "description": "Updates the ActionPlanCampaign row. The `action_plan` field accepts the serialized plan steps; the rest are top-level metadata.",
                "operationId": "actionPlanCampaignUpdate",
                "parameters": [
                    {
                        "name": "action_plan",
                        "in": "path",
                        "description": "ActionPlanCampaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "template_name",
                                    "action_plan",
                                    "plan_type_id"
                                ],
                                "properties": {
                                    "template_name": {
                                        "description": "Persisted as `name` on the row",
                                        "type": "string",
                                        "example": "3-touch follow-up"
                                    },
                                    "action_plan": {
                                        "description": "Serialized plan steps payload",
                                        "type": "string"
                                    },
                                    "plan_type_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "pause_on_reply": {
                                        "type": "boolean",
                                        "nullable": true
                                    },
                                    "no_sunday_comm": {
                                        "description": "Stored as `no_sunday_communication`",
                                        "type": "boolean",
                                        "nullable": true
                                    },
                                    "notify_completed": {
                                        "type": "boolean",
                                        "nullable": true
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Action plan updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Action plan updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Action plan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Action plan not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan-type": {
            "get": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Get list of action plan types",
                "operationId": "9eb9633b5ad388607600d7370faf89e5",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Create a new action plan type",
                "operationId": "20d44cb6446eb314fb2561ef9d2c9ef3",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the action plan type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Follow-up Campaign"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the action plan type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Campaign for following up with leads"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan type created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "plan": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Action plan type create successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan-type-delete-multiple": {
            "post": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Delete multiple action plan types",
                "operationId": "9d9136a2b8b19bb2dc421892771e5bf2",
                "parameters": [
                    {
                        "name": "ids",
                        "in": "query",
                        "description": "Array of action plan type IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan types deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Types Deleted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred while deleting action plan types"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/action-plan-type/{action_plan_type}": {
            "get": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Display the specified action plan type",
                "operationId": "f6bd4b827f1aa0c4f3232d02da9b8ff9",
                "parameters": [
                    {
                        "name": "action_plan_type",
                        "in": "path",
                        "description": "ID of the action plan type",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan type retrieved successfully"
                    },
                    "404": {
                        "description": "Action plan type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Update the specified action plan type",
                "operationId": "0616268fbf2010d7c56a0dfb70e1d035",
                "parameters": [
                    {
                        "name": "action_plan_type",
                        "in": "path",
                        "description": "ID of the action plan type to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the action plan type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the action plan type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan type updated successfully"
                    },
                    "404": {
                        "description": "Action plan type not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Action Plan Types"
                ],
                "summary": "Delete the specified action plan type",
                "operationId": "3599209fe122e26d5b4bf2df2e8bf3d9",
                "parameters": [
                    {
                        "name": "action_plan_type",
                        "in": "path",
                        "description": "ID of the action plan type to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Action plan type deleted successfully"
                    },
                    "404": {
                        "description": "Action plan type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-activities": {
            "get": {
                "tags": [
                    "Activities"
                ],
                "summary": "Get a list of activities",
                "operationId": "24f37521e42ff1c1273eed3adde8ae3d",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering activities",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering activities",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "activities": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "isFrom": {
                                            "type": "string",
                                            "example": "database"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-action-activities": {
            "post": {
                "tags": [
                    "Activities"
                ],
                "summary": "Get activities related to a lead",
                "operationId": "b6adb948e486773ba5ad69d67b3ba872",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "filter_value",
                        "in": "query",
                        "description": "Filter value (number of days to look back, 0 for all)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_action_activity_counts": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "lead_action_activities": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "fetch_from": {
                                            "type": "string",
                                            "example": "Elastic"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-team-member-activities": {
            "post": {
                "tags": [
                    "Activities"
                ],
                "summary": "Get activities for a team member",
                "operationId": "974d363878718d032aa079be032a63d7",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering activities",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering activities",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    },
                    {
                        "name": "appliedFiltersComType",
                        "in": "query",
                        "description": "Applied filters for communication type",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "com_type": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "appliedFilters",
                        "in": "query",
                        "description": "Applied filters",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "cont_type": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-activity/{id}": {
            "get": {
                "tags": [
                    "Activities"
                ],
                "summary": "Get a specific activity by ID",
                "operationId": "f231499c7085d1334bb78ecdb47b38ec",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Activity ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "activity": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Activity not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/download-twilio-recording/{id}": {
            "get": {
                "tags": [
                    "Activities"
                ],
                "summary": "Download a Twilio recording",
                "operationId": "e9718709d44b1a3d90eaa56672b20ff3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Activity ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audio file",
                        "content": {
                            "audio/wav": {}
                        }
                    },
                    "404": {
                        "description": "Recording not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "URL not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "An error occurred"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-activities-log": {
            "get": {
                "tags": [
                    "Activity"
                ],
                "summary": "Get the latest activity-log entry per log_name for the user's client",
                "description": "Returns one row per `log_name` (most recent), filtered to a curated allow/deny list of log types. Each returned entry includes per-table totals counted across the last 30 days. Used to power the dashboard recent-activities widget.",
                "operationId": "getActivitiesLog",
                "responses": {
                    "200": {
                        "description": "Aggregated activity log",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "activities": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "description": "Total matching activity count",
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "description": "ceil(total / 10)",
                                            "type": "integer"
                                        },
                                        "isFrom": {
                                            "description": "Data source label",
                                            "type": "string",
                                            "example": "from database due to elastic off in env"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-admin-users": {
            "post": {
                "tags": [
                    "Admin"
                ],
                "summary": "Get all admin users for a specific client",
                "operationId": "c210bd4227b3a2ac1b8668b6752381dd",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Admin users retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "allAdminUsers": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No admin users found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No Admin Users Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-user-info": {
            "post": {
                "tags": [
                    "Admin"
                ],
                "summary": "Get information about a specific user",
                "operationId": "368d9356bd18dc0ecf0ed7abbdd01389",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user_info": {
                                            "properties": {
                                                "first_name": {
                                                    "type": "string",
                                                    "example": "John"
                                                },
                                                "last_name": {
                                                    "type": "string",
                                                    "example": "Doe"
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "format": "email",
                                                    "example": "john.doe@example.com"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "mobile_number": {
                                                    "type": "string",
                                                    "example": "+1234567890"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No user information found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No User Information Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence-report/{cadence_id}": {
            "get": {
                "tags": [
                    "AI Cadence Report"
                ],
                "summary": "Get AI Cadence action report",
                "description": "Get AI Cadence report showing all actions taken step by step",
                "operationId": "9ae3d3ca17ab9b24c965859968c5161d",
                "parameters": [
                    {
                        "name": "cadence_id",
                        "in": "path",
                        "description": "AI Cadence Setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Filter by date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Filter by lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{cadence_id}/activity-logs": {
            "get": {
                "tags": [
                    "AI Cadence Report"
                ],
                "summary": "Get AI Cadence activity logs with detailed information",
                "description": "Get activity logs for cadence",
                "operationId": "5c0d1978a2c1a88c2436a43021ea1252",
                "parameters": [
                    {
                        "name": "cadence_id",
                        "in": "path",
                        "description": "AI Cadence Setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "channel",
                        "in": "query",
                        "description": "Filter by channel (EMAIL, SMS, CALL)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status (sent, failed)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Filter by date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Filter by lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Records per page",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{cadence_id}/report": {
            "get": {
                "tags": [
                    "AI Cadence Report"
                ],
                "summary": "Get AI Cadence report with summary, actions timeline and leads status",
                "operationId": "1c07628ce21e68e432bb7a8df8d3abd4",
                "parameters": [
                    {
                        "name": "cadence_id",
                        "in": "path",
                        "description": "AI Cadence Setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Filter conversations by date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Filter activity logs by lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "summary": {
                                            "type": "object"
                                        },
                                        "actions": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "leads_status": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "activity_logs": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{cadence_id}/report/lead/{lead_id}": {
            "get": {
                "tags": [
                    "AI Cadence Report"
                ],
                "summary": "Get detailed AI Cadence report for a specific lead",
                "operationId": "d46315499f90988ea0e5503b9f6c586b",
                "parameters": [
                    {
                        "name": "cadence_id",
                        "in": "path",
                        "description": "AI Cadence Setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead": {
                                            "type": "object"
                                        },
                                        "conversations": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "communication_preference": {
                                            "type": "object"
                                        },
                                        "call_logs": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Cadence setting or lead not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/client/{client_id}": {
            "get": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Get the AI cadence setting for a specific client",
                "operationId": "4439ecf83a3e094463b6d5db4c7f1af2",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "path",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cadence setting retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No cadence found for this client"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/user/{user_id}": {
            "get": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Get the AI cadence setting for a specific AI user",
                "operationId": "f98bfbd0ecae19fec2497e0f5ee28230",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "ID of the AI user",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cadence settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "position_stages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "selected_position": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "selected_stages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No cadence found for this user"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/step1": {
            "post": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Save step 1 of the AI cadence wizard (basic company info)",
                "operationId": "16eafbef4b35341c59a84bd35a03980e",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "manager_name",
                        "in": "query",
                        "description": "Name of the manager",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "contact_number",
                        "in": "query",
                        "description": "Contact phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "business_type",
                        "in": "query",
                        "description": "Type of business",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "company_address",
                        "in": "query",
                        "description": "Company address",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "business_details",
                        "in": "query",
                        "description": "Detailed business description (155-1000 characters)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000,
                            "minLength": 155
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Existing AI user ID; if omitted a new AI agent user is created",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Existing cadence setting ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Step 1 saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Step 1 saved successfully."
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{id}/step2": {
            "post": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Save step 2 of the AI cadence wizard (communication setup)",
                "operationId": "5e63608258456e67996ad6416378c9fb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the cadence setting",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sms_enabled",
                        "in": "query",
                        "description": "Whether SMS is enabled",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sms_number",
                        "in": "query",
                        "description": "SMS number (required if sms_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "call_enabled",
                        "in": "query",
                        "description": "Whether outbound calls are enabled",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "call_number",
                        "in": "query",
                        "description": "Call number (required if call_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "call_preference",
                        "in": "query",
                        "description": "Call provider preference (required if call_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "default",
                                "elevenlabs"
                            ]
                        }
                    },
                    {
                        "name": "elevenlabs_voice",
                        "in": "query",
                        "description": "ElevenLabs voice ID (required if call_preference is elevenlabs)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "call_voice_gender",
                        "in": "query",
                        "description": "Voice gender (required if call_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "male",
                                "female"
                            ]
                        }
                    },
                    {
                        "name": "email_enabled",
                        "in": "query",
                        "description": "Whether email is enabled",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "email_provider",
                        "in": "query",
                        "description": "Email provider (required if email_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "gmail",
                                "outlook"
                            ]
                        }
                    },
                    {
                        "name": "email_user_id",
                        "in": "query",
                        "description": "Email account user ID (required if email_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "booking_enabled",
                        "in": "query",
                        "description": "Whether booking is enabled",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "booking_provider",
                        "in": "query",
                        "description": "Booking provider (required if booking_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "google",
                                "outlook"
                            ]
                        }
                    },
                    {
                        "name": "booking_user_id",
                        "in": "query",
                        "description": "Booking account user ID (required if booking_enabled is true)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "timezone",
                        "in": "query",
                        "description": "Timezone for the AI user",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 50
                        }
                    },
                    {
                        "name": "max_per_week",
                        "in": "query",
                        "description": "Maximum communications per week",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "wait_before_follow_up",
                        "in": "query",
                        "description": "Wait time (days) before follow up",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "weekend_communication",
                        "in": "query",
                        "description": "Whether to communicate on weekends",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "yes",
                                "no"
                            ]
                        }
                    },
                    {
                        "name": "business_start_time",
                        "in": "query",
                        "description": "Business start time (HH:mm)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "time"
                        }
                    },
                    {
                        "name": "business_end_time",
                        "in": "query",
                        "description": "Business end time (HH:mm)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "time"
                        }
                    },
                    {
                        "name": "communication_tone",
                        "in": "query",
                        "description": "Tone of communication",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "formal",
                                "neutral",
                                "friendly"
                            ]
                        }
                    },
                    {
                        "name": "stop_on_lead_response",
                        "in": "query",
                        "description": "Whether to stop cadence on lead response",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "notify_sales_team",
                        "in": "query",
                        "description": "Whether to notify sales team",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "yes",
                                "no"
                            ]
                        }
                    },
                    {
                        "name": "team_member",
                        "in": "query",
                        "description": "Team member user ID to notify",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notification_email",
                        "in": "query",
                        "description": "Email address to send notifications to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "greeting_message",
                        "in": "query",
                        "description": "Greeting message (supports {{name}} placeholder)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Step 2 saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Step 2 saved successfully."
                                        },
                                        "id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{id}/step3": {
            "post": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Save step 3 of the AI cadence wizard (lead assignment)",
                "operationId": "4e5fdcfab597b2d1180ee4e74fe0f931",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the cadence setting",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assignment_type",
                        "in": "query",
                        "description": "How leads are assigned to the cadence",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ai",
                                "leads",
                                "position"
                            ]
                        }
                    },
                    {
                        "name": "team_member",
                        "in": "query",
                        "description": "Team member ID (required if assignment_type is ai)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "selected_leads",
                        "in": "query",
                        "description": "Selected lead IDs (required if assignment_type is leads)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "selected_position",
                        "in": "query",
                        "description": "Selected positions with stages (required if assignment_type is position)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "position_id": {
                                        "type": "integer"
                                    },
                                    "stages": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Optional message",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Cadence status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Step 3 saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Step 3 saved successfully."
                                        },
                                        "id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{id}/position-stages": {
            "get": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Get the position stages mapped to an AI cadence setting",
                "operationId": "c7e367c2025d20e33513d92d48e9a4e7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the cadence setting",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Position stages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/{id}/status/{status}": {
            "patch": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Update the status of an AI cadence setting",
                "operationId": "9e15b16df7e098078ab28766f714968f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the cadence setting",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "path",
                        "description": "New status",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Status updated."
                                        },
                                        "status": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Cadence setting not found"
                    },
                    "422": {
                        "description": "Invalid status"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/reset-lead-booking": {
            "post": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Reset a lead's AI communication so the AI agent can contact them again",
                "operationId": "f8d75633b04df79aabb4ac55a5ce53a3",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "ai_user_id",
                        "in": "query",
                        "description": "ID of the AI user",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead reset successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead reset. AI agent will contact this lead again."
                                        },
                                        "data": {
                                            "properties": {
                                                "lead_id": {
                                                    "type": "integer"
                                                },
                                                "ai_user_id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or communication preference not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-users/datatable/get": {
            "post": {
                "tags": [
                    "AI Cadence Settings"
                ],
                "summary": "Get AI cadence settings as a datatable response for the current client",
                "operationId": "210d214d01cd789467bf4a3c5ea81a59",
                "responses": {
                    "200": {
                        "description": "Datatable response retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/start": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Start (or resume) a setup interview phone call to the authenticated user",
                "description": "The setup assistant calls the given number (falling back to the user's profile mobile number) and interviews them; an unfinished session (calling / in_progress / abandoned / failed) is resumed rather than starting over.",
                "operationId": "59e957b23044872f516af9eef95bdbf4",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "phone_number": {
                                        "description": "Number to call; defaults to the user's mobile number",
                                        "type": "string",
                                        "example": "+447700900000",
                                        "nullable": true,
                                        "maxLength": 20
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Call initiated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Setup call started. You will receive a call shortly."
                                        },
                                        "session_id": {
                                            "type": "integer"
                                        },
                                        "call_sid": {
                                            "type": "string",
                                            "example": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, no phone number available, or the call could not be started (session marked failed)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiCadenceSetupError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/browser-token": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Create/resume a setup session and issue a Twilio browser-calling token",
                "description": "Lets the user talk to the setup assistant directly from the browser (no phone needed) via the fixed setup-robot TwiML app. The token is valid for 1 hour.",
                "operationId": "ee3888bb960c8e9b768b329ed27ee97a",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "fresh": {
                                        "description": "When true, discards any unfinished interview and starts fresh instead of resuming it",
                                        "type": "boolean",
                                        "example": false,
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Access token issued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "token": {
                                            "description": "Twilio JWT access token with a voice grant for the setup-robot TwiML app",
                                            "type": "string"
                                        },
                                        "identity": {
                                            "description": "Client identity encoded in the token",
                                            "type": "string",
                                            "example": "setup_42_20260825120000"
                                        },
                                        "session_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Voice-guided setup is not configured on this server",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiCadenceSetupError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/current": {
            "get": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "The user's latest unfinished setup session, if any",
                "description": "Returns the most recent session in calling / in_progress / abandoned / failed / pending_review status, so the review of what was already discussed can be shown before continuing. data is null when there is nothing to resume.",
                "operationId": "e690fe221837d016e51197761b7e7666",
                "responses": {
                    "200": {
                        "description": "Latest unfinished session or null",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "nullable": true,
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/AiCadenceSetupSessionPayload"
                                                }
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/{id}/status": {
            "get": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Live progress of a setup session, for the frontend to poll",
                "operationId": "7e20e2066f930bcb099b49bf70d17319",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Setup session ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Session progress",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AiCadenceSetupSessionPayload"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Setup session not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiCadenceSetupError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/{id}/confirm": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Confirm the reviewed details and create the AI agent",
                "description": "Only allowed while the session is pending_review, and refused if a review-chat change left a required detail missing. The agent is always created as an inactive draft first; when status=active is requested it only goes live if its activation prerequisites are met — otherwise it stays inactive and the blocking reasons are returned in the 422 message (with the created ids).",
                "operationId": "64be64d2751b96d70bfd8441489f78b5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Setup session ID (must belong to the caller)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "status": {
                                        "description": "Whether the created agent should go live now; defaults to inactive",
                                        "type": "string",
                                        "example": "inactive",
                                        "nullable": true,
                                        "enum": [
                                            "active",
                                            "inactive"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "AI agent created (active or saved as inactive)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your AI agent has been created and is now active."
                                        },
                                        "ai_cadence_setting_id": {
                                            "type": "integer"
                                        },
                                        "ai_user_id": {
                                            "description": "User id of the created AI agent",
                                            "type": "integer"
                                        },
                                        "status": {
                                            "type": "string",
                                            "enum": [
                                                "active",
                                                "inactive"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Session not found / not pending_review / a detail is still missing / creation failed / activation blocked (agent kept inactive; ids included)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/AiCadenceSetupError"
                                        },
                                        {
                                            "properties": {
                                                "ai_cadence_setting_id": {
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "ai_user_id": {
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/{id}/chat": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Review chat: adjust collected details in plain text before confirming",
                "description": "Only allowed while the session is pending_review.",
                "operationId": "a16f0ec3d5268cb9a560e07dc49fb1ea",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Setup session ID (must belong to the caller)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "message"
                                ],
                                "properties": {
                                    "message": {
                                        "description": "The change the user wants, in plain text",
                                        "type": "string",
                                        "example": "Also send SMS follow-ups, and call in the afternoon instead",
                                        "maxLength": 1000
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Assistant reply and the updated details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "reply": {
                                            "description": "Assistant's answer to the requested change",
                                            "type": "string"
                                        },
                                        "collected_data": {
                                            "description": "Updated raw collected answers",
                                            "type": "object"
                                        },
                                        "collected_display": {
                                            "description": "Updated human-readable values",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, session not found, or session not awaiting confirmation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiCadenceSetupError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/{id}/chat-voice": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Voice variant of the review chat: speak the change instead of typing it",
                "description": "The uploaded recording is transcribed and applied through the same review-chat flow. Only allowed while the session is pending_review.",
                "operationId": "9ed30015ea4979c49fda0dc1c3e470f2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Setup session ID (must belong to the caller)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "audio"
                                ],
                                "properties": {
                                    "audio": {
                                        "description": "Audio recording of the requested change (webm/ogg/mpeg/mp3/mp4/wav/aac/m4a, max 10 MB)",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Assistant reply, the updated details, and what was heard",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "reply": {
                                            "type": "string"
                                        },
                                        "collected_data": {
                                            "type": "object"
                                        },
                                        "collected_display": {
                                            "type": "object"
                                        },
                                        "heard": {
                                            "description": "Transcription of the uploaded audio, echoed back so the UI can show it",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, session not found, session not awaiting confirmation, transcription failed, or nothing was heard",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiCadenceSetupError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-cadence/setup-call/twiml": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Twilio voice webhook of the setup-robot TwiML app (public)",
                "description": "Public Twilio webhook (no authentication). Called when the browser (or phone) leg connects: links the CallSid to the setup session, creates the interview conversation, starts recording, and answers with the ConversationRelay TwiML that runs the interview. With an unknown session or missing CallSid it still responds 200 with a spoken apology and hang-up.",
                "operationId": "0b2fdcdc3e2a216a1a4a15b6f656eaba",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "properties": {
                                    "session_id": {
                                        "description": "Setup session id, passed through from the TwiML app configuration",
                                        "type": "integer"
                                    },
                                    "CallSid": {
                                        "description": "Twilio Call SID of the connecting call",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "TwiML voice instructions (always 200)",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string",
                                    "example": "<Response><Connect><ConversationRelay url=\"wss://...\" welcomeGreeting=\"...\"/></Connect></Response>"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/ai-cadence/setup-call/status-callback": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Twilio status callback for setup calls (public)",
                "description": "Public Twilio webhook (no authentication). When a setup call ends before the interview finished, the session is marked abandoned (call completed) or failed (busy / no-answer / failed / canceled) so it can be resumed later.",
                "operationId": "7f195daeb6cd616d78b700857ffaca85",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "properties": {
                                    "CallSid": {
                                        "type": "string"
                                    },
                                    "CallStatus": {
                                        "type": "string",
                                        "enum": [
                                            "queued",
                                            "ringing",
                                            "in-progress",
                                            "completed",
                                            "busy",
                                            "no-answer",
                                            "failed",
                                            "canceled"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged (always success, even for unknown calls)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/ai-cadence/setup-call/recording-callback": {
            "post": {
                "tags": [
                    "AI Cadence Setup Call"
                ],
                "summary": "Twilio recording callback for setup calls (public)",
                "description": "Public Twilio webhook (no authentication). Stores the finished recording URL and duration on the setup conversation so incomplete sessions can be reviewed with playback. Only completed recordings on cadence_setup conversations are stored.",
                "operationId": "be2ba8dfb67be0f0abc2acd32a987562",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "properties": {
                                    "CallSid": {
                                        "type": "string"
                                    },
                                    "RecordingUrl": {
                                        "type": "string"
                                    },
                                    "RecordingStatus": {
                                        "type": "string",
                                        "enum": [
                                            "in-progress",
                                            "completed",
                                            "absent"
                                        ]
                                    },
                                    "RecordingDuration": {
                                        "description": "Recording length in seconds",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Acknowledged (always success, even when nothing was stored)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/ai-call/make-ai-call": {
            "post": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Initiate an AI-powered outbound call to a lead",
                "operationId": "5df854052f98c60ec60cd6150fdbb751",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead to call",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number to dial",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user initiating the call",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI call initiated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error initiating the AI call"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-call/call-status": {
            "post": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Get the status of an AI call by Twilio call SID",
                "operationId": "4425a0d7ef4cf2c19ad2371235e76474",
                "parameters": [
                    {
                        "name": "call_sid",
                        "in": "query",
                        "description": "Twilio call SID to fetch status for",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "call_sid": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "direction": {
                                                    "type": "string"
                                                },
                                                "duration": {
                                                    "type": "string"
                                                },
                                                "start_time": {
                                                    "type": "string"
                                                },
                                                "end_time": {
                                                    "type": "string"
                                                },
                                                "from": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "type": "string"
                                                },
                                                "price": {
                                                    "type": "string"
                                                },
                                                "price_unit": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error fetching call status"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-call/voice-input": {
            "get": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Twilio voice input webhook (GET) for AI call interactions",
                "operationId": "dcdc00b127c41108f6dd9e1554dd0b04",
                "parameters": [
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Twilio call SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Caller phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Current call status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "AccountSid",
                        "in": "query",
                        "description": "Twilio account SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TwiML voice response"
                    },
                    "500": {
                        "description": "Voice input processing error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Twilio voice input webhook (POST) for AI call interactions",
                "operationId": "8b95e0a1aedfb9bf7ec4b66e8e2e5872",
                "parameters": [
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Twilio call SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Caller phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Current call status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "AccountSid",
                        "in": "query",
                        "description": "Twilio account SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TwiML voice response"
                    },
                    "500": {
                        "description": "Voice input processing error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-call/speech-to-text": {
            "post": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Twilio speech-to-text webhook for AI call transcription",
                "operationId": "ac02605194b32ec10ddfe6851ae3b564",
                "parameters": [
                    {
                        "name": "SpeechResult",
                        "in": "query",
                        "description": "Recognized speech text from caller",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Twilio call SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Caller phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Current call status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "AccountSid",
                        "in": "query",
                        "description": "Twilio account SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Confidence",
                        "in": "query",
                        "description": "Speech recognition confidence score",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TwiML response generated from the speech input"
                    },
                    "500": {
                        "description": "Speech-to-text processing error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-relay": {
            "post": {
                "tags": [
                    "AI Call"
                ],
                "summary": "Relay a user message to the AI agent and stream the reply",
                "operationId": "573077c642ea5e3487641d1312bf4381",
                "parameters": [
                    {
                        "name": "call_sid",
                        "in": "query",
                        "description": "Twilio call SID identifying the conversation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_message",
                        "in": "query",
                        "description": "User message to relay to the AI agent",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Streaming AI reply text or call-end JSON response"
                    },
                    "422": {
                        "description": "Validation error or missing conversation"
                    },
                    "500": {
                        "description": "Unhandled AI relay error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-urls-from-sitemap": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Get URLs from a sitemap",
                "operationId": "07216fb99ff1984dd99b873ba1380b57",
                "parameters": [
                    {
                        "name": "sitemap_url",
                        "in": "query",
                        "description": "URL of the sitemap to fetch",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "https://example.com/sitemap.xml"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/start-fine-tuning": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Start fine-tuning the AI chatbot",
                "operationId": "2cf381fac520cfaed730dec5ec7efd72",
                "parameters": [
                    {
                        "name": "sitemap_url_list",
                        "in": "query",
                        "description": "List of sitemap URLs to process",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "example": "https://example.com/page1.html"
                            }
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Text content to process",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/test-chroma-db": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Test ChromaDB connection",
                "operationId": "616db27489aa741155b0e374e60229a6",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/start-embedding-urls": {
            "get": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Start embedding URLs for AI chatbot",
                "operationId": "ac7fe56d039949578801bac3f9036530",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                }
            }
        },
        "/api/start-embedding-content": {
            "get": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Start embedding content for AI chatbot",
                "operationId": "48b2eaddd6ae9d17f735322ae3c697a5",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                }
            }
        },
        "/api/get-collection-info": {
            "get": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Get information about the ChromaDB collection",
                "operationId": "2672fb303f788ab214e47f9a6753f3b4",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                }
            }
        },
        "/api/ask-ai": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Ask a question to the AI chatbot",
                "operationId": "ce285ee7244f74c3d6fe5eb435046088",
                "parameters": [
                    {
                        "name": "question",
                        "in": "query",
                        "description": "Question to ask the AI",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "How can Telagus help my business?"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-if-ai-chatbot-data-exist": {
            "get": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Check if AI chatbot data exists for the current user's client",
                "operationId": "ddb7829b67c043f7ff693f3a1fb1ab08",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Chatbot not setup yet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot/url-data-table/get": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Get datatable of AI chatbot URLs",
                "operationId": "2e283e4ef86f226c6d337b758e46499a",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot-url/{id}": {
            "delete": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Delete an AI chatbot URL",
                "operationId": "f92f6012189d4191760df5e0e3bd953f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the URL to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "URL not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot/text-data-table/get": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Get datatable of AI chatbot text content",
                "operationId": "c807435d4f10c2fbf1eb635b282b8cb2",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot-text/{id}": {
            "delete": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Delete an AI chatbot text content",
                "operationId": "b89c97578e69e3c1e697dfa807d69e60",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the text content to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Text content not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot/files": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Upload a chatbot training document",
                "description": "The file is stored and queued; the start-embedding-files cron extracts its text and embeds it into the knowledge base, same as URL and pasted-text sources. Optionally scoped to one chat widget — without chat_widget_id the document is shared across all of the client's widgets.",
                "operationId": "605a1533a0b9bd80f8fac6b762032115",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "description": "Training document, max 10 MB; allowed types: pdf, docx, txt, csv, md",
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "chat_widget_id": {
                                        "description": "Widget to scope the document to (must belong to the caller's client); omit for shared",
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "File queued for training",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "We have started training ai chatbot and it will be available for use soon."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot/file-data-table/get": {
            "post": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "DataTables list of the client's chatbot training files",
                "description": "Newest first. chat_widget_id filters to one widget's files (pass the literal string \"shared\" for widget-less shared files); include_shared=true additionally includes shared files alongside a widget's own.",
                "operationId": "9397839349161095f0a2c4e421e18c7f",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "chat_widget_id": {
                                        "description": "Widget id, or \"shared\" for widget-less files",
                                        "type": "string",
                                        "example": "5",
                                        "nullable": true
                                    },
                                    "include_shared": {
                                        "description": "With a widget id: also include shared files",
                                        "type": "boolean",
                                        "nullable": true
                                    },
                                    "draw": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "start": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "length": {
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables page of files",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "original_name": {
                                                        "type": "string"
                                                    },
                                                    "size": {
                                                        "description": "File size in bytes",
                                                        "type": "integer"
                                                    },
                                                    "is_processed": {
                                                        "description": "1 once embedded into the knowledge base",
                                                        "type": "integer",
                                                        "enum": [
                                                            0,
                                                            1
                                                        ]
                                                    },
                                                    "chat_widget_id": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "chat_widget_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-chatbot-file/{id}": {
            "delete": {
                "tags": [
                    "AI Chatbot"
                ],
                "summary": "Delete a chatbot training file and its embeddings",
                "description": "Removes the stored file, its knowledge-base embeddings, and the record. Note the error contract: an unknown id (or another client's file) answers 422 with an `error` key, while a failure during deletion answers 200 with success: false.",
                "operationId": "c3629cd882744d605a90ff3404a36336",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Training file ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted — or a caught deletion failure with success: false",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Training data related to deleted file are removed."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "File not found for this client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Status Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-email-templates/generate": {
            "post": {
                "tags": [
                    "AI Email Templates"
                ],
                "summary": "Generate email template using AI",
                "description": "Generate an email template using AI with BrandKit data and user-provided information",
                "operationId": "c99bc979e78f90c3f0ec0ac44a0d73ba",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "purpose"
                                ],
                                "properties": {
                                    "email_type": {
                                        "description": "Type of email (promotional, newsletter, transactional, event, etc) - Optional",
                                        "type": "string",
                                        "example": "promotional"
                                    },
                                    "name": {
                                        "description": "Template name",
                                        "type": "string",
                                        "example": "Summer Sale Email"
                                    },
                                    "purpose": {
                                        "description": "Purpose of the email",
                                        "type": "string",
                                        "example": "Promote summer sale event"
                                    },
                                    "tone": {
                                        "description": "Tone (professional, casual, friendly, formal, etc)",
                                        "type": "string",
                                        "example": "professional"
                                    },
                                    "target_audience": {
                                        "description": "Target audience",
                                        "type": "string",
                                        "example": "existing customers"
                                    },
                                    "call_to_action": {
                                        "description": "Primary call-to-action text",
                                        "type": "string",
                                        "example": "Shop Now"
                                    },
                                    "additional_notes": {
                                        "description": "Additional notes for the generator",
                                        "type": "string",
                                        "example": "Include special discount code"
                                    },
                                    "image_prompt": {
                                        "description": "Prompt for AI image generation (optional, uses DALL-E 3)",
                                        "type": "string",
                                        "example": "Create a vibrant summer sale banner"
                                    },
                                    "save_as_template": {
                                        "description": "Save the generated template",
                                        "type": "boolean",
                                        "example": false
                                    },
                                    "category_id": {
                                        "description": "Category ID if saving as template",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Email template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email template generated successfully"
                                        },
                                        "template": {
                                            "properties": {
                                                "name": {
                                                    "type": "string"
                                                },
                                                "subject": {
                                                    "type": "string"
                                                },
                                                "preview_text": {
                                                    "type": "string"
                                                },
                                                "json_body": {
                                                    "description": "JSON for Unlayer editor",
                                                    "type": "string"
                                                },
                                                "html_body": {
                                                    "description": "HTML preview",
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "saved_template": {
                                            "description": "Saved template object if save_as_template=true",
                                            "type": "object"
                                        },
                                        "token_usage": {
                                            "properties": {
                                                "prompt_tokens": {
                                                    "type": "integer"
                                                },
                                                "completion_tokens": {
                                                    "type": "integer"
                                                },
                                                "total_tokens": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or insufficient credits"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Server error or AI processing failed"
                    }
                }
            }
        },
        "/api/ai-email-templates/save-template": {
            "post": {
                "tags": [
                    "AI Email Templates"
                ],
                "summary": "Save confirmed email template",
                "description": "Save a confirmed generated email template to campaign_templates table",
                "operationId": "e05fb8180515939e264ce97b90444d8b",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "subject",
                                    "html_body",
                                    "json_body"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Template name",
                                        "type": "string",
                                        "example": "Summer Sale Email"
                                    },
                                    "subject": {
                                        "description": "Email subject line",
                                        "type": "string",
                                        "example": "50% Off Summer Sale"
                                    },
                                    "html_body": {
                                        "description": "HTML content of the email",
                                        "type": "string"
                                    },
                                    "json_body": {
                                        "description": "JSON structure for Unlayer editor",
                                        "type": "string"
                                    },
                                    "preview_text": {
                                        "description": "Preview text for email clients",
                                        "type": "string",
                                        "example": "Check out our summer sale"
                                    },
                                    "category_id": {
                                        "description": "Template category ID (optional)",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "description": {
                                        "description": "Template description (optional)",
                                        "type": "string",
                                        "example": "Summer promotion template"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Template saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template saved successfully"
                                        },
                                        "template": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "subject": {
                                                    "type": "string"
                                                },
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "client_id": {
                                                    "type": "integer"
                                                },
                                                "category_id": {
                                                    "type": "integer"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                }
            }
        },
        "/api/ai-email-templates/suggestions": {
            "get": {
                "tags": [
                    "AI Email Templates"
                ],
                "summary": "Get template suggestions",
                "description": "Get suggested template configurations based on email type",
                "operationId": "3cf6c79402145e50d92e2060f16ae65c",
                "parameters": [
                    {
                        "name": "email_type",
                        "in": "query",
                        "description": "Type of email (promotional, newsletter, transactional, event, etc)",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Suggestions retrieved successfully"
                    }
                }
            }
        },
        "/api/ai-email-templates/types": {
            "get": {
                "tags": [
                    "AI Email Template"
                ],
                "summary": "List the supported AI email-template categories",
                "description": "Returns the static catalogue of email types (promotional, newsletter, transactional, event, welcome, retention, feedback). The list is hard-coded in the controller.",
                "operationId": "aiEmailTemplateGetEmailTypes",
                "responses": {
                    "200": {
                        "description": "Email types catalogue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "types": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "example": "promotional"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Promotional"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "example": "Marketing emails to promote products or services"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template-for-quote": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for quote",
                "operationId": "dc06b2a9eedc136ff1353c516e3967ca",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate quote template",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 300,
                            "minLength": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for email or campaign content",
                "operationId": "ec9e2b69cb09f46a6b7355723fd18f29",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate template",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 32,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "contentOrTemplate",
                        "in": "query",
                        "description": "Flag to determine if generating content (true) or template (false)",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-ai-credits": {
            "get": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Get available AI credits for the authenticated user",
                "operationId": "4ddac28cefa0c0fa755861ba35d6cd37",
                "responses": {
                    "200": {
                        "description": "AI credits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "purchased_ai_credits": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "ai_credits": {
                                            "type": "integer",
                                            "example": 7
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-ai-credits-by-type": {
            "get": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Get available AI credits by type (content/image) for the authenticated user",
                "operationId": "ecea02a9799b4fc3fa0b9c4bb09852d8",
                "responses": {
                    "200": {
                        "description": "AI credits by type retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "purchased_ai_credits": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "ai_credits": {
                                            "type": "integer",
                                            "example": 7
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template-for-invoice": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for invoice description",
                "operationId": "551582409e05489b05aab8ff9f496042",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate invoice description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000,
                            "minLength": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template-for-contract": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for contract description",
                "operationId": "70cc2e19b2637c6c77b8a82bb290f959",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate contract description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000,
                            "minLength": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template-for-contract-html": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for default contract agreement HTML with placeholder tokens",
                "operationId": "ea3d8bcffe7f51afedf881437fd49735",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate default contract template",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000,
                            "minLength": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-ai-template-for-email": {
            "post": {
                "tags": [
                    "AI Templates"
                ],
                "summary": "Generate AI template for email content body",
                "operationId": "39a83faf2965ad9a6657484d95a20256",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "description": "Query to generate email content",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000,
                            "minLength": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credit_exhausted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "content_exist": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "stop_due_to_tokens": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings/modules": {
            "get": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Get all available modules with training data for the current client",
                "operationId": "9831768efd2f99d70dc893ef036328f5",
                "responses": {
                    "200": {
                        "description": "Modules retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Modules retrieved successfully"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings/by-module": {
            "post": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Get AI training records for the current user filtered by module",
                "operationId": "b7d1b228614556612687982a492cc203",
                "parameters": [
                    {
                        "name": "module_name",
                        "in": "query",
                        "description": "Module name to filter by",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training records retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training records retrieved successfully"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings/bulk-import": {
            "post": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Bulk import AI training records",
                "operationId": "40b35c78816d66579b0525ad9498fb7a",
                "parameters": [
                    {
                        "name": "trainings",
                        "in": "query",
                        "description": "Array of training records to import",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "module_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "AI training records created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training records created successfully"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings/upsert": {
            "post": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Create or update an AI training record for the current user and module",
                "operationId": "894beaf440d55f3b8c16cb29d1456f16",
                "parameters": [
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Training text",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "module_name",
                        "in": "query",
                        "description": "Module name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training record updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training record updated successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "AI training record created successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings": {
            "get": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Get a paginated list of AI training records for the current client",
                "operationId": "09042205eff1d1f8881ad26a6752ca84",
                "parameters": [
                    {
                        "name": "my_records",
                        "in": "query",
                        "description": "When true, only return records owned by the authenticated user",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "module_name",
                        "in": "query",
                        "description": "Filter by module name",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term to match against training text",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of records per page (default 15)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training records retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training records retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Create a new AI training record",
                "operationId": "327eb0fc24eae710056177f7eb1dce18",
                "parameters": [
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Training text",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "module_name",
                        "in": "query",
                        "description": "Module name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "AI training record created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training record created successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-trainings/{ai_training}": {
            "get": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Get a specific AI training record",
                "operationId": "cf187c34fa69e8175dfa6fbf0be27ed8",
                "parameters": [
                    {
                        "name": "ai_training",
                        "in": "path",
                        "description": "ID of the AI training record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training record retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training record retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "AI training record not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Update a specific AI training record",
                "operationId": "4ef4818bb9659b2f89963fdc86904cb2",
                "parameters": [
                    {
                        "name": "ai_training",
                        "in": "path",
                        "description": "ID of the AI training record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Training text",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "module_name",
                        "in": "query",
                        "description": "Module name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training record updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training record updated successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "AI training record not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "AI Training"
                ],
                "summary": "Delete (soft delete) a specific AI training record",
                "operationId": "3ddfd14635c3f4c4c60c5ff085efde02",
                "parameters": [
                    {
                        "name": "ai_training",
                        "in": "path",
                        "description": "ID of the AI training record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI training record deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AI training record deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "AI training record not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/today-announcement": {
            "get": {
                "tags": [
                    "Announcements"
                ],
                "summary": "Get today's announcement for the authenticated user's client",
                "operationId": "4b684020fe85bef811ca33047a75cc17",
                "responses": {
                    "200": {
                        "description": "Announcement retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "announcement": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "event_date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "2023-01-01"
                                                },
                                                "winner_name": {
                                                    "type": "string",
                                                    "example": "John Doe"
                                                },
                                                "profile_img": {
                                                    "type": "string",
                                                    "example": "path/to/image.jpg"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No announcement found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "announcement": {
                                            "type": "string",
                                            "example": "No any announcement found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get daily attendance records",
                "operationId": "5497713c1433b66fe1fcbbcf98c4f48d",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date for attendance records (defaults to current date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "export",
                        "in": "query",
                        "description": "Export data to Excel if set",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance data retrieved successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/daily-export": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Export daily attendance records to Excel",
                "operationId": "afcae7a9c6b041431ca9b1e305e9fa27",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date for attendance records (defaults to current date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Excel file download",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/custom": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get custom date range attendance records",
                "operationId": "605025a9088d948070500e132d8eea33",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "export",
                        "in": "query",
                        "description": "Export data to Excel if set",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance data retrieved successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/custom-export": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Export custom date range attendance records to Excel",
                "operationId": "2392bdd5563532033ff3a8bdbcda4e43",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Excel file download",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/summary": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get summary of attendance records for a date range",
                "operationId": "fc38efa97b61edb535d5f9ed2282aa83",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "export",
                        "in": "query",
                        "description": "Export data to Excel if set",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance summary data retrieved successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/summary-export": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Export summary of attendance records to Excel",
                "operationId": "f1886457359f11c078d6956125a7ba49",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for attendance records",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by specific user ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Excel file download",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/start-stop-work": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Start or stop work time tracking",
                "operationId": "88af4fe87947b7c01cd60dd60e65444a",
                "responses": {
                    "200": {
                        "description": "Work time tracking started or stopped successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "logged_in": {
                                            "type": "boolean"
                                        },
                                        "logged_in_time": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "members_in_office": {
                                            "type": "integer"
                                        },
                                        "members_not_in_office": {
                                            "type": "integer"
                                        },
                                        "members_in_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "members_not_in_office_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or device restriction"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/add-time-manually": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Add attendance time manually",
                "operationId": "4d212cfcba1b4d7aa28c62143873ff7b",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID for the attendance record",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date and time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 09:00:00"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date and time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 17:00:00"
                        }
                    },
                    {
                        "name": "note",
                        "in": "query",
                        "description": "Note about the manual time entry",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Time added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Time added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/get-attendance-info": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get current attendance status for the authenticated user",
                "operationId": "c755ce74b04fbf12f54a605ddf3d7909",
                "responses": {
                    "200": {
                        "description": "Attendance information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "is_logged_in": {
                                            "type": "boolean"
                                        },
                                        "in_time": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "time_completed": {
                                            "description": "Total time worked today across all sessions (including the running one), formatted as HH:MM:SS.",
                                            "type": "string",
                                            "example": "02:07:15"
                                        },
                                        "members_in_office": {
                                            "type": "integer"
                                        },
                                        "members_not_in_office": {
                                            "type": "integer"
                                        },
                                        "members_in_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "members_not_in_office_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/get/{id}": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get a specific attendance record",
                "operationId": "635f6b6723cafa1bb8be78b0bd6479ae",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the attendance record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance record retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "in_time": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "out_time": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "status": {
                                            "type": "integer"
                                        },
                                        "in_ip_address": {
                                            "type": "string"
                                        },
                                        "out_ip_address": {
                                            "type": "string"
                                        },
                                        "note": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Attendance record not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Attendance Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/{id}": {
            "put": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Update an attendance record",
                "operationId": "8c09d4bd357b10196608b3be5e43f302",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the attendance record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID for the attendance record",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "in_time",
                        "in": "query",
                        "description": "Start date and time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 09:00:00"
                        }
                    },
                    {
                        "name": "out_time",
                        "in": "query",
                        "description": "End date and time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 17:00:00"
                        }
                    },
                    {
                        "name": "note",
                        "in": "query",
                        "description": "Note about the attendance record",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance record updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Attendance Updated Successfully"
                                        },
                                        "attendance": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or attendance record not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Attendance Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Delete an attendance record",
                "operationId": "6c3df039726dcd51567a11e085b34221",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the attendance record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance record deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Attendance Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Attendance record not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Attendance Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-attendance-report": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Get monthly attendance report for a user",
                "operationId": "e190a308aa9d15b248ce8d0d63651d0d",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID for the attendance report",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "description": "Year for the attendance report",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 2023
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attendance report retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Retrieve attendance data successfully."
                                        },
                                        "attendance_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "final_report": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/current-month-client-report-pdf": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Email a current-month attendance PDF report to internal recipients",
                "description": "Generates a monthly attendance PDF for Client id=1 (hard-coded in the controller, regardless of the `client_id` query parameter — the parameter is validated but ignored) and emails it to a fixed list of internal recipients.",
                "operationId": "attendanceCurrentMonthClientReportPdf",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Required for validation but ignored at runtime — the controller always uses Client id=1.",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report emailed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Attendance report emailed successfully."
                                        },
                                        "to": {
                                            "description": "Hard-coded recipient list",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "format": "email"
                                            }
                                        },
                                        "file_name": {
                                            "description": "Name of the generated PDF",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Client not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Client not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Mail-send error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Failed to send email: ..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/report": {
            "post": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Day-wise attendance report as a DataTables response",
                "operationId": "5775810c0d8b459a0bdfb40ae6b15a2d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-08-01"
                                    },
                                    "end_date": {
                                        "description": "Must be on or after start_date",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-08-25"
                                    },
                                    "user_ids": {
                                        "description": "Restrict to these users; omit for all of the client's users",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables page of report rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AttendanceReportRow"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/attendance/report-export": {
            "get": {
                "tags": [
                    "Attendance"
                ],
                "summary": "Download the day-wise attendance report as an Excel file",
                "description": "Same data as POST /api/attendance/report, exported as attendance-report.xlsx.",
                "operationId": "1f11fafc3165df253581a4de78292d55",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Must be on or after start_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "user_ids[]",
                        "in": "query",
                        "description": "Restrict to these users; omit for all",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "attendance-report.xlsx download",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/auth-link": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Get Auth Link for user",
                "operationId": "3257ad7ee0edbecf8df93e8c5d95bfec",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://example.com/auth/link"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/auth-callback": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Handle Google OAuth callback (GET) and authenticate or initiate registration",
                "operationId": "e55ba02e117a9e800d3ed2ad590f4f8d",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by Google",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "membership_id",
                        "in": "query",
                        "description": "Optional membership ID for new user registration",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authentication or registration initiation result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or membership plan not selected"
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            },
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Google OAuth callback to authenticate or register user",
                "operationId": "51de4f55b4a7fd53b4204511780cef30",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Google",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "4/0AX4XfWhJ..."
                        }
                    },
                    {
                        "name": "membership_id",
                        "in": "query",
                        "description": "Optional membership ID for new user registration",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User authenticated or registration initiated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "oneOf": [
                                        {
                                            "description": "Existing user login response",
                                            "properties": {
                                                "user": {
                                                    "type": "object"
                                                },
                                                "user_info": {
                                                    "type": "object"
                                                },
                                                "xero_info": {
                                                    "type": "object"
                                                },
                                                "access_token": {
                                                    "type": "string"
                                                },
                                                "columns_grid_of_custom_fields_info": {
                                                    "type": "object"
                                                },
                                                "columns_grid_of_leads_info": {
                                                    "type": "object"
                                                },
                                                "choose_module_info": {
                                                    "type": "object"
                                                },
                                                "social": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "social_reg": {
                                                    "type": "boolean",
                                                    "example": false
                                                }
                                            },
                                            "type": "object"
                                        },
                                        {
                                            "description": "New user registration initiation response",
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "request": {
                                                    "type": "object"
                                                },
                                                "social": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "social_reg": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "membership_id": {
                                                    "type": "string",
                                                    "example": "123"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or membership plan not selected",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Select membership plan to register."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/register": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user and create associated client if not provided",
                "operationId": "3339a2b705752d3138eb1ab2065314bb",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "User's first name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "John"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "User's last name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Doe"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "john.doe@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "User's password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "secret123"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Name of the company for which the client account will be created",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Doe Enterprises"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Optional client ID to associate the user with an existing client",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User registered successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "description": "User data",
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "description": "User profile and address info",
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "description": "Xero client data",
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "description": "OAuth access token",
                                            "type": "string"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "choose_module_info": {
                                            "description": "Module access settings",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/register-with-google": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user using Google login",
                "operationId": "7d99886f8fa0b7cf832ea080f83ed5b0",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "User's first name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Jane"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "User's last name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Smith"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address (must be unique)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "jane.smith@gmail.com"
                        }
                    },
                    {
                        "name": "social_media_signup",
                        "in": "query",
                        "description": "Flag to indicate social media signup (Google/Facebook etc)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User registered with Google successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "description": "User data",
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "description": "User profile and address info with roles/permissions",
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "description": "Xero client data",
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "description": "OAuth access token",
                                            "type": "string"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "choose_module_info": {
                                            "description": "Module access settings",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Authenticate user and generate access token",
                "operationId": "cedc357ccaf4ce407af980198100ec53",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "User's password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "123456789"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "description": "User data",
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "description": "Profile and address info with role and permissions",
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "description": "Xero client data",
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "description": "OAuth access token",
                                            "type": "string"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "choose_module_info": {
                                            "description": "Module access settings",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid credentials"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-user-data": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Authenticate and return user data including roles, permissions, and client-specific configurations",
                "operationId": "6e17272de9bb53361e5aef389933d2fc",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "properties": {
                                                "role": {
                                                    "type": "string",
                                                    "example": "Admin"
                                                },
                                                "permissions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "team_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "xero_info": {
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "type": "string",
                                            "example": "eyJ0eXAiOiJKV1QiLCJhb..."
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "choose_module_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/login-with-email-address": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Login using email address",
                "operationId": "975ace4027050974fa33b04bbd362a4e",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "type": "string",
                                            "example": "eyJ0eXAiOiJKV1QiLC..."
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "choose_module_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The email field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No user found with given email address"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forgot-password": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Initiate forgot password process and send reset email",
                "operationId": "8dca355c66953ef89a88b464cac857fe",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Registered email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Reset link sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "An email with link to reset your password is sent to your email. Please check your mailbox to reset your password."
                                        },
                                        "token": {
                                            "type": "string",
                                            "example": "abc123xyz...token"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "404": {
                        "description": "No user found with given email address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No user found with given email address."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Exception message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/validate-reset-token": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Reset user password using token",
                "operationId": "f492ac2e175d9346b7c0174d837315ec",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Password reset token",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456abcdef"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "New password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "newSecurePassword123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Password reset successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Password has been changed successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid token or email",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid token provided"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/reset-password": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Reset user password",
                "operationId": "bf1a37dc2f19b836ebf160d4e9857da1",
                "responses": {
                    "200": {
                        "description": "Password reset successful"
                    }
                }
            }
        },
        "/api/unsubscribe/{id}": {
            "get": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Unsubscribe a lead contact from communications",
                "operationId": "a8b09c95680799c208f7e7650bf3c7af",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead contact ID to unsubscribe",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to unsubscribe confirmation page or home page"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-verification": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Initiate phone verification after validating user details and Google reCAPTCHA",
                "operationId": "2c47077671dd5fb5cea612ab623fa411",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "John"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Doe"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "john.doe@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Password for the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "MySecurePass123"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name for the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Example Ltd"
                        }
                    },
                    {
                        "name": "g_recaptcha_response",
                        "in": "query",
                        "description": "Google reCAPTCHA v3 response token",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "03AFcWeA..."
                        }
                    },
                    {
                        "name": "mobile_number[e164Number]",
                        "in": "query",
                        "description": "Phone number in E.164 format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+447911123456"
                        }
                    },
                    {
                        "name": "mobile_number[countryCode]",
                        "in": "query",
                        "description": "ISO country code for the mobile number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GB"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Verification code sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "verification code sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation or phone lookup error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid request or phone number"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/verify-phone/{cust_cookie}": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Verify phone number with the code sent via SMS",
                "operationId": "f541e76055172e35281c8ffea89b0583",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "John",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Doe",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "john.doe@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "User password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "MySecurePass123"
                        }
                    },
                    {
                        "name": "verification_code",
                        "in": "query",
                        "description": "Verification code sent via SMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Example Ltd",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "t_plan",
                        "in": "query",
                        "description": "Selected plan ID or identifier",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "basic_plan"
                        }
                    },
                    {
                        "name": "mobile_number[e164Number]",
                        "in": "query",
                        "description": "Phone number in E.164 format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+447911123456"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone verification successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "request": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Phone verification failed or invalid code",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The verification code you have entered did not match."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/social-verify-phone": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Verify phone number for social media authenticated users",
                "operationId": "fc1e5840ef984320bd723fe078be4e9a",
                "parameters": [
                    {
                        "name": "verification_code",
                        "in": "query",
                        "description": "Verification code sent via SMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456"
                        }
                    },
                    {
                        "name": "mobile_number[e164Number]",
                        "in": "query",
                        "description": "Phone number in E.164 format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+447911123456"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone verification successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "team_id": {
                                            "type": "string"
                                        },
                                        "xero_info": {
                                            "type": "object"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "object"
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "object"
                                        },
                                        "choose_module_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Phone verification failed or invalid code",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The verification code you have entered did not match."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-roles": {
            "get": {
                "tags": [
                    "Roles"
                ],
                "summary": "Get all roles for the current team",
                "operationId": "e4a6091d3df7074cb0c21fad01debf11",
                "responses": {
                    "200": {
                        "description": "List of roles retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "role_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "admin"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/import-old-clients": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Import old clients from CSV file",
                "operationId": "d8ac6bb7d6bf2bcef87dccd1c4ddf217",
                "responses": {
                    "200": {
                        "description": "Clients imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "imported_clients": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/import-old-users": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Import old users from CSV file",
                "operationId": "499ffecc8d34b8e9b5633bfbc848cfd2",
                "responses": {
                    "200": {
                        "description": "Users imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "imported_users": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/import-lead-settings": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Import lead settings for clients",
                "operationId": "94ef19a975028edd0f466779cb3b96bc",
                "responses": {
                    "200": {
                        "description": "Lead settings imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead settings imported successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/import-projects": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Import projects from CSV file",
                "operationId": "5eff4799c5588a1663de10524aa3f73f",
                "responses": {
                    "200": {
                        "description": "Projects imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "imported_projects": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-verification-after-login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Send phone verification code after login (Twilio + reCAPTCHA v3)",
                "operationId": "c824c203a386ca9805a456c290d5dad1",
                "parameters": [
                    {
                        "name": "g_recaptcha_response",
                        "in": "query",
                        "description": "Google reCAPTCHA v3 response token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mobile_number[e164Number]",
                        "in": "query",
                        "description": "Phone number in E.164 format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+447911123456"
                        }
                    },
                    {
                        "name": "mobile_number[countryCode]",
                        "in": "query",
                        "description": "ISO country code for the mobile number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GB"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Verification code sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "verification code sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "reCAPTCHA failure or phone lookup error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/manual-register": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Register a new user manually",
                "operationId": "7867c38c910a7257ee9377b293771669",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "John"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Doe"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address of the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "john.doe@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Password for the user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password",
                            "example": "securePass123"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name for the new user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Example Ltd"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User registered successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The email has already been taken."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/verify-login-otp": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Verify the login OTP and complete the login (public)",
                "description": "Second step of 2FA login for clients with 2FA enabled: /api/login responds with {requires_otp: true} and emails a 6-digit code (valid 10 minutes). On a correct code this completes the login and returns the same authenticated payload as /api/login. After 3 wrong attempts the account is OTP-locked for 5 hours.",
                "operationId": "2604ddb49c47326a26547432b7d004d6",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "otp"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "otp": {
                                        "description": "The 6-digit code from the email",
                                        "type": "string",
                                        "example": "123456"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OTP verified; login completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AuthenticatedLoginPayload"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "User not found, incorrect code (with remaining_attempts), expired code, or account OTP-locked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": false,
                                            "nullable": true
                                        },
                                        "locked": {
                                            "description": "True when the account is OTP-locked (the message states the unlock time)",
                                            "type": "boolean",
                                            "nullable": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Incorrect verification code."
                                        },
                                        "remaining_attempts": {
                                            "description": "Attempts left before the account is locked; only on an incorrect code",
                                            "type": "integer",
                                            "example": 2,
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/resend-login-otp": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Resend a fresh login OTP (public)",
                "description": "Re-issues the 6-digit code on the user's pending verification, resetting its attempts and 10-minute expiry. A 60-second cooldown applies between sends and at most 3 resends are allowed per login attempt — after that (or once the code expired) the user must log in again.",
                "operationId": "8d708e3fea856616adadccdec0780b4d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "New code sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "A new verification code has been sent to your email."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "User not found, account OTP-locked, no pending verification, resend cap reached, or cooldown not elapsed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Please wait 42 seconds before requesting a new code."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/automation-list": {
            "post": {
                "tags": [
                    "Automation"
                ],
                "summary": "Get list of automations for datatable",
                "operationId": "3e42a1a877c6cb9f3a38f8480a68d71a",
                "responses": {
                    "200": {
                        "description": "List of automations retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation": {
            "get": {
                "tags": [
                    "Automation"
                ],
                "summary": "Get list of automations",
                "operationId": "9a7f1f5471baa4c286a08440f2e28f7a",
                "responses": {
                    "200": {
                        "description": "List of automations retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Automation"
                ],
                "summary": "Create a new automation",
                "operationId": "d3cd4d759f28b5a15a616ad036fa8609",
                "parameters": [
                    {
                        "name": "followup",
                        "in": "query",
                        "description": "Followup data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the automation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Automation saved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation/{id}": {
            "get": {
                "tags": [
                    "Automation"
                ],
                "summary": "Get automation details by ID",
                "operationId": "41388647390c953a2c951dfbdf0b32fe",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "followup": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "integer"
                                        },
                                        "execution_count": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Automation"
                ],
                "summary": "Update an existing automation",
                "operationId": "c76bee0b97b580a39d2ff4029fb12e27",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "followup",
                        "in": "query",
                        "description": "Followup data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the automation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Automation updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Automation"
                ],
                "summary": "Delete an automation",
                "operationId": "ca513627f48124ce064e3ef38f08bcfa",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Automation deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation/change-status": {
            "post": {
                "tags": [
                    "Automation"
                ],
                "summary": "Change the status of an automation",
                "operationId": "5fbdf6183d32b3973c8d2ec70ad39b19",
                "parameters": [
                    {
                        "name": "automation_id",
                        "in": "query",
                        "description": "ID of the automation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "New status value (0 or 1)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Automation status updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation/clone/{id}": {
            "get": {
                "tags": [
                    "Automation"
                ],
                "summary": "Clone an existing automation",
                "operationId": "8edc402277204ec16c41c54cc033093f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation to clone",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation cloned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "automation": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation-execution-list/{id}": {
            "post": {
                "tags": [
                    "Automation"
                ],
                "summary": "Get automation execution list with optional status filter",
                "operationId": "3f808107bad75c77f786035f67c7ae24",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "filter_by_status",
                        "in": "query",
                        "description": "Filter executions by followup_complete status",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Automation execution list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "executionList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "automationExecutionCount": {
                                            "type": "integer"
                                        },
                                        "automationExecutedCount": {
                                            "type": "integer"
                                        },
                                        "automation_paused_past_due": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-automation-execution-followup-plan/{id}": {
            "get": {
                "tags": [
                    "Automation"
                ],
                "summary": "Get followup plan for a specific automation execution",
                "operationId": "ad6875209ce7c6bce72e6bfd9873dd3b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the automation execution",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Followup plan retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "followupData": {
                                            "properties": {
                                                "followupData": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "automation": {
                                                    "type": "object"
                                                },
                                                "followup_wait_till": {
                                                    "type": "string"
                                                },
                                                "lead_id": {
                                                    "type": "integer"
                                                },
                                                "lead_position_id": {
                                                    "type": "integer"
                                                },
                                                "has_stages": {
                                                    "type": "boolean"
                                                },
                                                "automation_paused_past_due": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Automation Execution not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/automation-paused-status": {
            "get": {
                "tags": [
                    "Automation"
                ],
                "summary": "Whether automations are paused because the client's plan is past due",
                "description": "Lightweight flag used by the dashboard/automation pages to show the paused banner.",
                "operationId": "26b5e500b4f1b5aa3264a1e370327462",
                "responses": {
                    "200": {
                        "description": "Paused flag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "automation_paused_past_due": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/data-table/get": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "Get AWS email verification data in datatable format",
                "operationId": "ef7b36c38a0f2e41147ad2aa35d243bd",
                "parameters": [
                    {
                        "name": "draw",
                        "in": "query",
                        "description": "Draw counter for datatable",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Start index for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 10
                        }
                    },
                    {
                        "name": "search[value]",
                        "in": "query",
                        "description": "Search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order[0][column]",
                        "in": "query",
                        "description": "Column index to sort by",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order[0][dir]",
                        "in": "query",
                        "description": "Sort direction (asc or desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/list-identities": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "List all AWS SES identities",
                "operationId": "dcc386e86b1ec82cb08c50eb7f730eb8",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": "example@domain.com"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/list-identities-with-notification-attributes": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "List all AWS SES identities with their notification attributes",
                "operationId": "e2bb39e2ac049f9659b04cf3b287a797",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "example@domain.com": {
                                        "BounceTopic": "arn:aws:sns:eu-west-2:266847786463:telagus-sns-topic",
                                        "ComplaintTopic": "arn:aws:sns:eu-west-2:266847786463:telagus-sns-topic",
                                        "DeliveryTopic": "arn:aws:sns:eu-west-2:266847786463:telagus-sns-topic",
                                        "ForwardingEnabled": true,
                                        "HeadersInBounceNotificationsEnabled": true,
                                        "HeadersInComplaintNotificationsEnabled": true,
                                        "HeadersInDeliveryNotificationsEnabled": true
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/update-identities-notification-attributes-if-not-set": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Update notification attributes for all identities if not already set",
                "operationId": "b40cd8f409fd746649f45ad64983374c",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notifications SNS Topic updated for all identities."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SNS Topic for sending SNS notification no more exists."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/verify-email-address": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "Verify an email address with AWS SES",
                "operationId": "ec1fc8d0b85d523dc6e9204029e03a0c",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to verify",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Verification request has been sent successfully. Please check email and click the link to verify your identity."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/update-if-email-address-is-validated": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Update verification status of email addresses in the database",
                "operationId": "54e3d7d96ce3db1bde16be297c3ec6f3",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AWS verification status updated successfully"
                                        },
                                        "records_updated": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/delete-email/{id}": {
            "delete": {
                "tags": [
                    "AWS"
                ],
                "summary": "Delete an email identity from AWS SES and the database",
                "operationId": "64a882d7b4079b98af1e2d422f79f42e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the email verification record",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email verification record not found"
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/check-if-email-is-verified": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Check if an email address is verified with AWS SES",
                "operationId": "12b38277fe68c150512925bbcc4b116e",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to check",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_verified_email": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/create-custom-email-template": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "Create a new AWS SES custom verification email template",
                "operationId": "20038bce00d522a07c13ae5219a3220d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "template_name",
                                    "from_email_address",
                                    "template_subject",
                                    "template_content",
                                    "success_redirection_url",
                                    "failure_redirection_url"
                                ],
                                "properties": {
                                    "template_name": {
                                        "description": "Name of the custom verification email template",
                                        "type": "string",
                                        "example": "MyCustomTemplate"
                                    },
                                    "from_email_address": {
                                        "description": "The email address that the custom verification email is sent from",
                                        "type": "string",
                                        "format": "email",
                                        "example": "verify@example.com"
                                    },
                                    "template_subject": {
                                        "description": "The subject line of the custom verification email",
                                        "type": "string",
                                        "example": "Please verify your email address"
                                    },
                                    "template_content": {
                                        "description": "The content of the custom verification email (must include {{verificationUrl}} placeholder)",
                                        "type": "string",
                                        "example": "<html><head></head><body><h1>Please verify your email address</h1><p>To verify your email address, please click on the following link: <a href='{{verificationUrl}}'>Verify Email</a></p></body></html>"
                                    },
                                    "success_redirection_url": {
                                        "description": "The URL that the recipient is sent to if their address is successfully verified",
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://example.com/success"
                                    },
                                    "failure_redirection_url": {
                                        "description": "The URL that the recipient is sent to if their address is not successfully verified",
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://example.com/failure"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Custom verification email template created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "AWS SES API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/verify-domain": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "Initiate AWS SES domain verification",
                "description": "Starts DKIM verification for a domain with AWS SES, sets a MAIL FROM subdomain (mail.<domain>), and returns the DNS records the caller must add at their DNS provider. If the domain row already exists and is verified, returns the existing record verbatim without re-running SES setup.",
                "operationId": "618a803eebd5f8e2bada5a4b513d68bc",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "domain",
                                    "client_id"
                                ],
                                "properties": {
                                    "domain": {
                                        "description": "Domain to verify. Must match /^([a-z0-9]([a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,}$/i.",
                                        "type": "string",
                                        "example": "example.com"
                                    },
                                    "client_id": {
                                        "description": "Client ID this verification belongs to",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "user_id": {
                                        "description": "Created-by user. Falls back to the authenticated user's id when omitted.",
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Verification initiated (or already verified). Returned in both cases — inspect the `verified` flag.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "domain": {
                                            "type": "string"
                                        },
                                        "mail_from_domain": {
                                            "type": "string",
                                            "example": "mail.example.com"
                                        },
                                        "dns_records": {
                                            "description": "DKIM + MAIL FROM CNAME/MX records to add at the DNS provider",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "verified": {
                                            "type": "boolean"
                                        },
                                        "mail_from_status": {
                                            "type": "string",
                                            "example": "pending"
                                        },
                                        "dmarc_status": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Failed to initiate domain verification with AWS SES"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/update-if-domain-is-validated": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Re-check verification status for every tracked domain",
                "description": "Public endpoint (withoutMiddleware('auth:api')) intended for scheduled execution. Re-checks every non-deleted domain — including ones currently marked verified — against both SES status and live DNS, and mirrors the result back to the row (regression-aware). Returns a per-domain snapshot.",
                "operationId": "5d63054401f0adaa380e3ca89a60278e",
                "responses": {
                    "200": {
                        "description": "Sync complete (or no rows to check)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "records_updated": {
                                            "type": "integer"
                                        },
                                        "records_regressed": {
                                            "description": "Domains that went from verified=1 to verified=0 in this run",
                                            "type": "integer"
                                        },
                                        "domains": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "domain": {
                                                        "type": "string"
                                                    },
                                                    "mail_from_domain": {
                                                        "type": "string"
                                                    },
                                                    "verified": {
                                                        "type": "boolean"
                                                    },
                                                    "verification_status": {
                                                        "type": "string",
                                                        "enum": [
                                                            "success",
                                                            "failed",
                                                            "pending"
                                                        ]
                                                    },
                                                    "mail_from_status": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "dmarc_status": {
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "SES unreachable — handler refuses to downgrade healthy rows when it can't reach AWS",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Could not reach AWS SES. Please try again shortly."
                                        },
                                        "records_updated": {
                                            "type": "integer",
                                            "example": 0
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/aws/domain-data-table/get": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "List domain verifications for DataTables",
                "description": "Returns AwsDomainVerification rows in DataTables JSON. Super-admin (client_id=1) sees all rows; everyone else is scoped to their own client_id. created_at/updated_at are timezone-converted.",
                "operationId": "38e2a329c5e5da341f63aefe85f61b0e",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "DataTables.net request payload (draw/start/length/search/order/columns). All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables JSON payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/verified-identities/data-table/get": {
            "post": {
                "tags": [
                    "AWS"
                ],
                "summary": "List all verified identities (emails + domains) for DataTables",
                "description": "Merges AwsEmailVerification and AwsDomainVerification rows into one DataTables payload. Super-admin sees all rows by default; pass scope_to_current_client=true to restrict to the caller's client. Supports search across identity/client name/type, and offset/length pagination. Each row carries a `type` field of 'email' or 'domain'.",
                "operationId": "797e8b029f27a95dbc47c2a3c8cb50e2",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "draw": {
                                        "type": "integer"
                                    },
                                    "start": {
                                        "description": "Offset (defaults to 0)",
                                        "type": "integer"
                                    },
                                    "length": {
                                        "description": "Page size (defaults to 10; non-positive values are also treated as 10)",
                                        "type": "integer"
                                    },
                                    "search": {
                                        "description": "DataTables search payload. value matches against identity, client_company_name, or type.",
                                        "type": "object"
                                    },
                                    "scope_to_current_client": {
                                        "description": "When true on a super-admin call, scopes results to the caller's client_id. Non-super-admin callers are always scoped regardless.",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables JSON payload with merged email+domain rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "enum": [
                                                            "email",
                                                            "domain"
                                                        ]
                                                    },
                                                    "identity": {
                                                        "description": "Email address (for type=email) or domain (for type=domain)",
                                                        "type": "string"
                                                    },
                                                    "verified": {
                                                        "type": "integer",
                                                        "enum": [
                                                            0,
                                                            1
                                                        ]
                                                    },
                                                    "verification_status": {
                                                        "type": "string",
                                                        "enum": [
                                                            "success",
                                                            "pending",
                                                            "failed"
                                                        ]
                                                    },
                                                    "client_id": {
                                                        "type": "integer"
                                                    },
                                                    "client_company_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "created_by": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/get-domain-dns-records/{id}": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Get the DNS records for a stored domain verification",
                "description": "Rebuilds the DKIM + MAIL FROM CNAME/MX records (plus a DMARC status check) for the given AwsDomainVerification row. Useful for re-displaying instructions after the initial /verify-domain call.",
                "operationId": "26fb434ab8aad255b902ae7ec8927a2c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "AwsDomainVerification row ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DNS records and status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "domain": {
                                            "type": "string"
                                        },
                                        "mail_from_domain": {
                                            "type": "string"
                                        },
                                        "dns_records": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "verified": {
                                            "type": "boolean"
                                        },
                                        "verification_status": {
                                            "type": "string",
                                            "enum": [
                                                "success",
                                                "failed",
                                                "pending"
                                            ]
                                        },
                                        "mail_from_status": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "dmarc_status": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Domain verification record not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Domain verification record not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/check-if-domain-is-verified": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Check whether a domain is verified",
                "description": "Returns true if the domain is locally marked verified=1 in AwsDomainVerification; otherwise falls back to a live SES status check (returns true only if SES reports 'Success').",
                "operationId": "fd82a1c0653a1cca2d9ba3ca70a6729e",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Domain to check. Must match the same regex as /verify-domain.",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Verified status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_verified_domain": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/verified-domains": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "List the caller's verified domain names",
                "description": "Returns a deduplicated, lower-cased list of domain names with verified=1. Super-admin (client_id=1) sees all clients' verified domains; everyone else is scoped to their own client_id.",
                "operationId": "3562858eb549d7d574e4158bd53f0ab5",
                "responses": {
                    "200": {
                        "description": "Domain names list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "domains": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/get-verification-options": {
            "get": {
                "tags": [
                    "AWS"
                ],
                "summary": "Get recommended verification method based on the auth user's email or a given sender email",
                "description": "Inspects the given email (query param) or, if omitted, the authenticated user's email. If it's on a public provider (gmail/yahoo/etc.), recommends per-email verification only. If it's on a custom domain, recommends domain verification (with email as a fallback) and suggests the domain to verify.",
                "operationId": "fc2447dcc14903a111a208668a4c999a",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Sender email to evaluate instead of the authenticated user's email (e.g. a campaign's from-email)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Recommended verification method",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user_email": {
                                            "type": "string"
                                        },
                                        "recommended_method": {
                                            "type": "string",
                                            "enum": [
                                                "email",
                                                "domain"
                                            ]
                                        },
                                        "allowed_methods": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "enum": [
                                                    "email",
                                                    "domain"
                                                ]
                                            }
                                        },
                                        "suggested_domain": {
                                            "description": "Present only when recommended_method=domain",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "is_public_provider": {
                                            "type": "boolean"
                                        },
                                        "reason": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Authenticated user has no email address",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Authenticated user has no email address."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/delete-domain/{id}": {
            "delete": {
                "tags": [
                    "AWS"
                ],
                "summary": "Delete an AwsDomainVerification row",
                "description": "Soft-deletes the row. If no other (non-deleted) row references the same domain, also calls SES DeleteIdentity to remove the verification from AWS. Otherwise the row is removed locally but the SES identity stays (because another client still uses it).",
                "operationId": "7d225e4e6be77cc38f85ac267f8cc304",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "AwsDomainVerification row ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Domain deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Row not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Domain verification record not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws-email-verification": {
            "get": {
                "tags": [
                    "AWS Email Verification"
                ],
                "summary": "Get all AWS email verifications for the authenticated user's client",
                "operationId": "7c0767a0a8feaa27c6a0fa0b8b37f5f9",
                "responses": {
                    "200": {
                        "description": "List of AWS email verifications",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "AWS Email Verification"
                ],
                "summary": "Create a new AWS email verification",
                "operationId": "7c686f3b0346d803f899f32cc3aaefb5",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to verify",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email verification created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email Has Been Added Successfully For Verification."
                                        },
                                        "aws_email_verification": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws-email-verification/{id}": {
            "get": {
                "tags": [
                    "AWS Email Verification"
                ],
                "summary": "Get a specific AWS email verification",
                "operationId": "2a87efb7c63f69403a789a984c9f38cb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "AWS email verification ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AWS email verification details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "AWS email verification not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No Email Verified With Given ID."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "AWS Email Verification"
                ],
                "summary": "Update an existing AWS email verification",
                "operationId": "e501f7ad8d8ca41c1b0d1bfbf7e7996c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "AWS email verification ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Updated email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "updated@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AWS email verification updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "AWS Email verification Updated Successfully."
                                        },
                                        "aws_email_verification": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "AWS email verification not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "AWS Email Verification"
                ],
                "summary": "Delete an AWS email verification",
                "operationId": "c4da8a41913a498422a5155cb01e109f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "AWS email verification ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AWS email verification deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "AWS Email Verification Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "AWS email verification not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "AWS Email Verification Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/aws/setup-hosting": {
            "post": {
                "tags": [
                    "AWS Hosting"
                ],
                "summary": "Setup AWS Hosting (Route 53, SSL, CloudFront)",
                "operationId": "9201d4e5f463c0c380317dabd7d8e127",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Domain name to setup hosting for",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    },
                    {
                        "name": "uuid",
                        "in": "query",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "550e8400-e29b-41d4-a716-446655440000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Hosting setup successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "hosted_zone_id": {
                                            "type": "string",
                                            "example": "Z2FDTNDATAQYW2"
                                        },
                                        "domain_name": {
                                            "type": "string",
                                            "example": "example.com"
                                        },
                                        "certificate_arn": {
                                            "type": "string",
                                            "example": "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012"
                                        },
                                        "cloudfront_domain": {
                                            "type": "string",
                                            "example": "d111111abcdef8.cloudfront.net"
                                        },
                                        "name_servers": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "data": {
                                            "description": "Website details",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            }
        },
        "/api/aws/check-certificate-status": {
            "post": {
                "tags": [
                    "AWS Hosting"
                ],
                "summary": "Verify SSL Certificate Status",
                "operationId": "ee02306891cf9123a16fb919bd35c029",
                "parameters": [
                    {
                        "name": "certificate_arn",
                        "in": "query",
                        "description": "ARN of the SSL certificate to check",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Certificate status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "certificate_status": {
                                            "type": "string",
                                            "example": "ISSUED"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            }
        },
        "/api/booking-management/staff": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "List staff members",
                "description": "Lists active users (status=1) for the authenticated client. Optional query filters: service_id (only staff assigned to that service), booking_form_id (only staff attached to that booking form; also eagerly loads the bookingForms relation with is_multiple/multiple_value pivot data).",
                "operationId": "b158510c3e17d51a6504c82c77b0052b",
                "parameters": [
                    {
                        "name": "service_id",
                        "in": "query",
                        "description": "Filter to staff assigned to this service",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "description": "Filter to staff attached to this booking form",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of staff members",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/staff/{serviceId}": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "List staff members (alternate route — path param currently ignored)",
                "description": "Same handler as GET /api/booking-management/staff. The {serviceId} path segment is registered in the route but the controller method's signature has no $serviceId parameter, so Laravel does not pass it through — filtering by service still requires the ?service_id= query parameter.",
                "operationId": "f92cb0cac6f2d66b8d5e0f2a42f508f4",
                "parameters": [
                    {
                        "name": "serviceId",
                        "in": "path",
                        "description": "Service ID (currently ignored — see description)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "service_id",
                        "in": "query",
                        "description": "Filter to staff assigned to this service",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "description": "Filter to staff attached to this booking form",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of staff members",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/user/{id}/services": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Get the services assigned to a user",
                "operationId": "23a55922cbc596ab3eebd09c30bd50cc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Services list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "services": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/users/{id}/services": {
            "put": {
                "tags": [
                    "Booking"
                ],
                "summary": "Replace the services assigned to a user",
                "description": "Syncs the user's services relation with the IDs in the request body. Validated by UserServicesRequest: services is required array, each services.* must exist in services.id.",
                "operationId": "f63754284a4734018acbf6991fa72184",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "services"
                                ],
                                "properties": {
                                    "services": {
                                        "description": "Service IDs to assign (replaces all existing assignments)",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Services assigned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Services assigned successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/users/{userId}/services/{serviceId}": {
            "delete": {
                "tags": [
                    "Booking"
                ],
                "summary": "Remove a single service from a user",
                "operationId": "53269c2259390389ba19d1ec9bd3ec52",
                "parameters": [
                    {
                        "name": "userId",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "serviceId",
                        "in": "path",
                        "description": "Service ID to detach",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Service detached",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "User removed from service successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/services/list": {
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "List services for DataTables",
                "description": "Returns all services for the authenticated client (ordered by updated_at desc) in DataTables JSON format. Accepts the standard DataTables.net request payload via body; an empty {} body is valid.",
                "operationId": "41d3408cf94b33a184eaf75c5db13cf6",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "DataTables.net request payload (draw/start/length/search/order/columns). All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables JSON payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/services": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "List services",
                "description": "Returns all services for the authenticated client. Optional ?booking_form_id= filter limits the list to services attached to that booking form.",
                "operationId": "9485dd23b62ad58d05f2ecf40ef4d862",
                "parameters": [
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "description": "Filter to services attached to this booking form",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Services list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "services": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "Create a service",
                "description": "Creates a new service for the authenticated client. ServiceAction also reads service_type from the request even though ServiceRequest doesn't validate it; pass it in the body if applicable.",
                "operationId": "589188a1161bb9d279ac5535aa4b6b9f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "duration",
                                    "price"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "duration": {
                                        "description": "Service duration in minutes (minimum 5)",
                                        "type": "integer",
                                        "minimum": 5
                                    },
                                    "price": {
                                        "type": "number",
                                        "format": "float",
                                        "minimum": 0
                                    },
                                    "status": {
                                        "description": "Defaults to 'active' when omitted on create",
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "active",
                                            "inactive"
                                        ]
                                    },
                                    "service_type": {
                                        "description": "Stored on the service row. Not validated by the FormRequest.",
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Service created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "service": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Service created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/services/{id}": {
            "put": {
                "tags": [
                    "Booking"
                ],
                "summary": "Update a service",
                "description": "Updates an existing service. Same fields as create — name/duration/price are required by ServiceRequest. status is only updated when explicitly passed (otherwise the existing value is preserved). service_type is read but not validated.",
                "operationId": "e578d564532eb47bd82c7f5d986b3fe3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Service ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "duration",
                                    "price"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "duration": {
                                        "type": "integer",
                                        "minimum": 5
                                    },
                                    "price": {
                                        "type": "number",
                                        "format": "float",
                                        "minimum": 0
                                    },
                                    "status": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "active",
                                            "inactive"
                                        ]
                                    },
                                    "service_type": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Service updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "service": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Service updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Service not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Booking"
                ],
                "summary": "Delete a service",
                "operationId": "180d9960d91dcd844d7178cb33817ad1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Service ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Service deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Service deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Service not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/staff/{staffId}/working-hours": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Get a staff member's working hours",
                "description": "Returns the staff member's user_time_slots rows. If empty, falls back to the legacy workingHours relation for backward compatibility.",
                "operationId": "2c7bfe8ae6f2e2a1ca1152e8d06c5cdc",
                "parameters": [
                    {
                        "name": "staffId",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Working hours",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "working_hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Staff not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Booking"
                ],
                "summary": "Replace a staff member's working hours",
                "description": "Deletes the staff member's existing user_time_slots rows and inserts the supplied set. If is_working=false for a day, start_time/end_time are stored as null regardless of what was sent.",
                "operationId": "f275f9c4a7b4827111f0e8d8175d34be",
                "parameters": [
                    {
                        "name": "staffId",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "working_hours"
                                ],
                                "properties": {
                                    "working_hours": {
                                        "description": "Per-day working hours rows",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "day",
                                                "is_working"
                                            ],
                                            "properties": {
                                                "day": {
                                                    "type": "string",
                                                    "enum": [
                                                        "Monday",
                                                        "Tuesday",
                                                        "Wednesday",
                                                        "Thursday",
                                                        "Friday",
                                                        "Saturday",
                                                        "Sunday"
                                                    ]
                                                },
                                                "is_working": {
                                                    "type": "boolean"
                                                },
                                                "start_time": {
                                                    "description": "Required time format H:i:s. Ignored when is_working=false.",
                                                    "type": "string",
                                                    "format": "time",
                                                    "example": "09:00:00",
                                                    "nullable": true
                                                },
                                                "end_time": {
                                                    "description": "Must be after start_time. Ignored when is_working=false.",
                                                    "type": "string",
                                                    "format": "time",
                                                    "example": "17:00:00",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Working hours updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "working_hours": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Working hours updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Staff not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/appointments": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "List appointments",
                "description": "Returns all appointments with service+user eagerly loaded. Optional filters via query params: start_date+end_date (whereBetween on appointment_date), staff_id, service_id, status.",
                "operationId": "ed4934d34ba28f4c9e0882e69a71af3f",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Lower bound on appointment_date (inclusive). Must be combined with end_date.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Upper bound on appointment_date (inclusive). Must be combined with start_date.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "staff_id",
                        "in": "query",
                        "description": "Filter by staff user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "service_id",
                        "in": "query",
                        "description": "Filter by service ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by appointment status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Appointments list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "appointments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/appointments/{id}/status": {
            "put": {
                "tags": [
                    "Booking"
                ],
                "summary": "Update an appointment's status",
                "operationId": "4bc14a74ed7d8b8f94d3230773fda595",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Appointment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "status"
                                ],
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "booked",
                                            "confirmed",
                                            "completed",
                                            "cancelled",
                                            "no-show"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Appointment status updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "appointment": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Appointment status updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Appointment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/appointments/{formId}": {
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "List appointments for a booking form (DataTables)",
                "description": "Returns appointments for the given booking form in DataTables JSON format. service and user relations are eagerly loaded. Request body is ignored (path parameter is the only input).",
                "operationId": "8a1cce34f60280e9089ae7d3bc7ff14b",
                "parameters": [
                    {
                        "name": "formId",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON payload of appointments",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking/services": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: list a booking form's services",
                "description": "Returns the services attached to a booking form, with each service's category eagerly loaded. Inline-validated: booking_form_id is required and must exist.",
                "operationId": "b2818225f2d0602d410ba2c08e675ae7",
                "parameters": [
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Services list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "services": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error (booking_form_id missing or doesn't exist)"
                    }
                }
            }
        },
        "/api/booking/staff-members": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: list staff members for a booking form + service",
                "description": "Returns staff attached to the booking form, each augmented with a has_timeslot count (number of working time-slot rows on this booking form) and a profile_img URL from user_info.",
                "operationId": "5fda0e7fcee3f61ac99239e0278d823f",
                "parameters": [
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "service_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Staff list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "staff_members": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/booking/available-time-slots": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: compute bookable time slots",
                "description": "Computes available time slots for a (booking_form, service, staff, date) combination, accounting for working hours, special-day overrides, public holidays (FestivalLeave), existing appointments, and multi-attendee slots (pivot.is_multiple/multiple_value). Returns time_slots plus contextual lists used by the booking UI.",
                "operationId": "9b80ecd27008a176fe8ec2841ca37eff",
                "parameters": [
                    {
                        "name": "booking_form_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "service_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date in Y-m-d format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Time slots + supporting calendar data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "time_slots": {
                                            "description": "Bookable start times. Empty when the staff isn't working that day or there's no remaining capacity.",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "time": {
                                                        "type": "string",
                                                        "example": "09:00"
                                                    },
                                                    "formatted_time": {
                                                        "type": "string",
                                                        "example": "9:00 AM"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "day_data": {
                                            "description": "Non-working day rows for the staff on this booking form",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "publicHolidays": {
                                            "description": "Upcoming FestivalLeave rows applicable to this staff",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "allSpecialDates": {
                                            "description": "Distinct dates marked as special on the booking form",
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/booking/create-appointment": {
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: create an appointment (and optionally start a Stripe Checkout session)",
                "description": "Creates a pending appointment, then branches by the booking form's payment_settings: if accept_payments=true and payment_method=stripe, returns a Stripe Checkout session URL (caller redirects user); if payment_method=cash, immediately marks the appointment booked and emails confirmations; if no payments are required, the appointment is booked immediately. Note: the controller has NO server-side validation despite the doc comment claiming otherwise — all fields below are consumed unconditionally.",
                "operationId": "db56ac4a0c03329fb4ac1e0e499e2b8f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "booking_form_id",
                                    "service_id",
                                    "user_id",
                                    "appointment_date",
                                    "appointment_time",
                                    "client_name",
                                    "client_email",
                                    "payment_method"
                                ],
                                "properties": {
                                    "booking_form_id": {
                                        "type": "integer"
                                    },
                                    "service_id": {
                                        "type": "integer"
                                    },
                                    "user_id": {
                                        "description": "Staff user ID",
                                        "type": "integer"
                                    },
                                    "appointment_date": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "appointment_time": {
                                        "description": "Time of appointment (e.g. '09:00' or '09:00:00')",
                                        "type": "string"
                                    },
                                    "client_name": {
                                        "type": "string"
                                    },
                                    "client_email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "client_phone": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "notes": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "payment_method": {
                                        "description": "When 'stripe' and accept_payments=true, the response includes a Stripe Checkout URL",
                                        "type": "string",
                                        "enum": [
                                            "stripe",
                                            "cash"
                                        ]
                                    },
                                    "extra_option": {
                                        "description": "When 'NonStripe' on cash payment_method, triggers an alternate email template",
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Appointment created. Response shape varies by payment branch — checkout_url is present for stripe flows, empty/absent otherwise.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "appointment": {
                                            "type": "object"
                                        },
                                        "checkout_url": {
                                            "description": "Stripe Checkout URL; only populated when payment_method=stripe and the form accepts payments",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Stripe configuration missing for the booking form's client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Stripe account not configured"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error (exception caught and surfaced)"
                    }
                }
            }
        },
        "/api/booking/retry-payment": {
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: create a fresh Stripe Checkout session for an existing appointment",
                "description": "Rebuilds a Stripe Checkout session for an existing appointment (used when the first payment attempt failed/timed out). The caller is expected to know the original appointment values and pass them back in the body.",
                "operationId": "bedb06d3e01dc7b43e9f8f44975d8427",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id",
                                    "booking_form_id",
                                    "service_id",
                                    "appointment_date",
                                    "appointment_time",
                                    "price",
                                    "client_email"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Appointment ID — used in success_url/cancel_url and as metadata.appointment_id",
                                        "type": "integer"
                                    },
                                    "booking_form_id": {
                                        "description": "Used to look up the client's StripeDetails",
                                        "type": "integer"
                                    },
                                    "service_id": {
                                        "type": "integer"
                                    },
                                    "appointment_date": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "appointment_time": {
                                        "type": "string"
                                    },
                                    "price": {
                                        "description": "Total amount in pounds; multiplied by 100 for Stripe's pence unit_amount",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "client_email": {
                                        "type": "string",
                                        "format": "email"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "New Stripe Checkout session created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "appointment": {
                                            "description": "Echo of the request body",
                                            "type": "object"
                                        },
                                        "checkout_url": {
                                            "description": "New Stripe Checkout session URL",
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Appointment created, proceed to payment"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/get-stripe-account-details/{formId}": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: get Stripe Connect status for a booking form's client",
                "description": "Looks up the latest StripeDetails for the booking form's client and reports one of three states: (1) not connected — returns auth_url to start OAuth; (2) onboarding incomplete (charges/payouts disabled) — returns onboarding link and auth_url; (3) fully connected — returns stripe_user_id, publishable key, and the connected account name. On Stripe authentication exceptions returns the auth_url to reconnect.",
                "operationId": "3150df31242cd397500f5ff1f017a737",
                "parameters": [
                    {
                        "name": "formId",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stripe connection status (always 200; status field carries the boolean result)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "True only when the connected account has charges_enabled and payouts_enabled",
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "auth_url": {
                                            "description": "Stripe OAuth authorize URL; present when not connected, disconnected, or in error fallback",
                                            "type": "string"
                                        },
                                        "onboarding_required": {
                                            "description": "Present when the account exists but onboarding is incomplete",
                                            "type": "boolean",
                                            "nullable": true
                                        },
                                        "url": {
                                            "description": "Stripe AccountLink onboarding URL; present when onboarding_required=true",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "stripe_user_id": {
                                            "description": "Present when fully connected",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "stripe_publishable_key": {
                                            "description": "Present when fully connected",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "account_name": {
                                            "description": "Connected account display name; company name for business accounts, first+last for individuals",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Booking form not found"
                    }
                }
            }
        },
        "/api/booking/appointments/{id}": {
            "get": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: get a single appointment",
                "description": "Returns one appointment with service, user, and bookingForm relations eagerly loaded. No auth — the appointment ID itself is the access token; intended for use from the booking confirmation page.",
                "operationId": "612975f0c3502440a811b31623fa6832",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Appointment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Appointment detail",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "appointment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Appointment not found or other server error (exception is caught and surfaced as 500)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/booking-stripe-webhook": {
            "post": {
                "tags": [
                    "Booking"
                ],
                "summary": "Public: Stripe webhook receiver for booking payments",
                "description": "Stripe webhook endpoint (no auth, no Stripe signature verification in this handler). Expects the raw Stripe event JSON body — reads via php://input. When the event carries metadata.appointment_id, updates the matching appointment's status to 'booked', payment_status to 'paid', stores the raw event object in payment_details, and sends confirmation emails. Returns no body on success (Laravel's implicit 200).",
                "operationId": "806d5f3b32a7e6a7dc24bc9a50447cc4",
                "requestBody": {
                    "description": "Raw Stripe event JSON. The handler reads it via php://input, not via the Request object, so any Content-Type works but the body must be valid JSON containing data.object.metadata.appointment_id for the handler to act.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event accepted (handler returns no body on success)"
                    },
                    "500": {
                        "description": "Exception thrown while processing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/booking-management/booking-form": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "List booking forms",
                "description": "Returns booking forms for the authenticated user, with optional filtering parameters supplied in the request body.",
                "operationId": "fa32ec567b18fcd862fded161672d295",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Optional filter parameters consumed by GetBookingFormAction",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "List of booking forms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Create a booking form",
                "description": "Creates a new booking form. Validates that all referenced staff IDs and service IDs exist.",
                "operationId": "f8fe9f32b699897bb6c7c10dda44ff3b",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Booking form name. Required (max 255 chars).",
                                        "type": "string"
                                    },
                                    "description": {
                                        "description": "Free-text description of the booking form",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "payment_settings": {
                                        "description": "JSON-encoded payment configuration (Stripe Connect, etc.)",
                                        "type": "object",
                                        "nullable": true
                                    },
                                    "is_active": {
                                        "description": "Whether the booking form is active. Defaults to true.",
                                        "type": "boolean"
                                    },
                                    "staff": {
                                        "description": "Array of user IDs assigned to this booking form. Each element must reference an existing users.id.",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "services": {
                                        "description": "Array of service IDs offered by this booking form. Each element must reference an existing services.id.",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Booking form created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "booking_form": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Booking form  created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms/{id}": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Get a booking form by ID",
                "description": "Returns a specific booking form with its services, staff, and form time slots.",
                "operationId": "8c02765590c3949f270afcc756ad48d4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking form details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "booking_form": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Booking form not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update a booking form",
                "description": "Updates fields on an existing booking form. Any field omitted from the body is left unchanged (UpdateBookingFormAction uses ?? fallbacks against the current row). When editMode=true, staff/services arrays are ignored even if provided.",
                "operationId": "4a6c6f3ad7e2b625dcde867501b1cdb3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "description": "Booking form name. Optional on update — omitting it preserves the current value.",
                                        "type": "string"
                                    },
                                    "description": {
                                        "description": "Free-text description",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "payment_settings": {
                                        "description": "JSON-encoded payment configuration (Stripe Connect, etc.)",
                                        "type": "object",
                                        "nullable": true
                                    },
                                    "is_active": {
                                        "description": "Whether the booking form is active",
                                        "type": "boolean"
                                    },
                                    "editMode": {
                                        "description": "When true, the action skips syncing the staff and services arrays even if they are provided in the body",
                                        "type": "boolean"
                                    },
                                    "staff": {
                                        "description": "Array of user IDs assigned to this booking form. Ignored when editMode=true.",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "services": {
                                        "description": "Array of service IDs offered by this booking form. Ignored when editMode=true.",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Booking form updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "booking_form": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Booking form updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Booking form not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Delete a booking form",
                "description": "Removes a booking form by ID.",
                "operationId": "b1776af4d226ff6b3a54a8beddffa081",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking form deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Booking form deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Booking form not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms/{formId}/staff/{userId}/time-slots": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Get form-specific time slots for a staff member",
                "description": "Returns the time slots and special days configured for a particular staff member on a booking form.",
                "operationId": "37a634b648da8d3b987e291948e64e71",
                "parameters": [
                    {
                        "name": "formId",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "userId",
                        "in": "path",
                        "description": "Staff user ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Time slots and special days for the staff member",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "time_slots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "special_days": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "is_multiple": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "multiple_value": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms/time-slots": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update form-specific time slots for a staff member",
                "description": "Sets the working time slots for one staff member on a booking form (type_of_hours = by-host). Disables the same-host special day rows for the form.",
                "operationId": "5e8f5d6f98d4c4964ff578920819f391",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "booking_form_id",
                                    "time_slots"
                                ],
                                "properties": {
                                    "booking_form_id": {
                                        "description": "Booking form ID (must exist)",
                                        "type": "integer"
                                    },
                                    "user_id": {
                                        "description": "Staff user ID; omit or null when applying to the form-level default",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "is_multiple": {
                                        "description": "Updates the staff pivot's is_multiple flag (whether this staff supports multiple-attendee slots)",
                                        "type": "boolean"
                                    },
                                    "multiple_value": {
                                        "description": "Updates the staff pivot's multiple_value (e.g., max attendees per slot when is_multiple=true)",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "time_slots": {
                                        "description": "Per-day time slot rows",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "day",
                                                "is_working"
                                            ],
                                            "properties": {
                                                "day": {
                                                    "type": "string",
                                                    "enum": [
                                                        "Monday",
                                                        "Tuesday",
                                                        "Wednesday",
                                                        "Thursday",
                                                        "Friday",
                                                        "Saturday",
                                                        "Sunday"
                                                    ]
                                                },
                                                "is_working": {
                                                    "type": "boolean"
                                                },
                                                "start_time": {
                                                    "type": "string",
                                                    "format": "time",
                                                    "example": "09:00:00",
                                                    "nullable": true
                                                },
                                                "end_time": {
                                                    "type": "string",
                                                    "format": "time",
                                                    "example": "17:00:00",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Time slots updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "time_slots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Form time slots updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms/all-time-slots": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Apply the same time slots to all staff on a booking form",
                "description": "Applies a single set of time slots to every staff member listed in the request (type_of_hours = same-host). Sets same_public_holiday=1 on the form and disables by-host special day rows.",
                "operationId": "557d7531df76791c45cf7daf1d5f7ba4",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "booking_form_id",
                                    "time_slots",
                                    "staff"
                                ],
                                "properties": {
                                    "booking_form_id": {
                                        "type": "integer"
                                    },
                                    "staff": {
                                        "description": "Staff to apply the slots to",
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "time_slots": {
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "day": {
                                                    "type": "string",
                                                    "enum": [
                                                        "Monday",
                                                        "Tuesday",
                                                        "Wednesday",
                                                        "Thursday",
                                                        "Friday",
                                                        "Saturday",
                                                        "Sunday"
                                                    ]
                                                },
                                                "is_working": {
                                                    "type": "boolean"
                                                },
                                                "start_time": {
                                                    "type": "string",
                                                    "format": "time",
                                                    "nullable": true
                                                },
                                                "end_time": {
                                                    "type": "string",
                                                    "format": "time",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Time slots applied to all listed staff",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "time_slots": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "time_slots": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Form time slots updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/booking-forms/special-days": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update special-day time slots for a booking form",
                "description": "Upserts a special-day record on a booking form (optionally scoped to a particular staff member). Activating a 'by-host' record deactivates any matching 'same-host' record on the same form, and vice-versa.",
                "operationId": "ca8a095afd7faa02a7b435c3afb42d19",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "booking_form_id"
                                ],
                                "properties": {
                                    "booking_form_id": {
                                        "description": "Booking form ID (required by the action; missing this throws an exception)",
                                        "type": "integer"
                                    },
                                    "user_id": {
                                        "description": "Staff user ID; omit or null when applying at the form level",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "days": {
                                        "description": "Stored verbatim into the special_days.time_slot column (typically a structured object/array of date overrides)"
                                    },
                                    "type_of_hours": {
                                        "description": "Mode of hours. Activating 'by-host' deactivates 'same-host' records on the same booking form, and vice-versa.",
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "by-host",
                                            "same-host"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Special-day time slots updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "time_slots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Form time slots updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/user-has-set-same-for-all/{formId}": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Check if a booking form uses same-for-all hours",
                "description": "Returns success=true when a special-day row exists for the booking form with no specific user (i.e., the form has been configured to use the same hours for every staff member).",
                "operationId": "e6fc7799c85c6f6867c483bb03e265ed",
                "parameters": [
                    {
                        "name": "formId",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "True when same-for-all hours is configured, false otherwise",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/check-slots-for-staff/{id}": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Check which staff have time slots configured for a booking form",
                "description": "Returns the list of staff on a booking form with a flag indicating whether each has at least one working time slot (regular or special-day) configured.",
                "operationId": "f81817632f17b7b399211f2cad428d50",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Staff list with availability flags",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "staff_slots": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "has_timeslot": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Booking form not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/public-holiday/{id}": {
            "put": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update public-holiday handling for a booking form",
                "description": "Sets the same_public_holiday flag on the booking form and upserts a special-day row recording the type_of_hours mode.",
                "operationId": "9835a2b8bf3773bc9017c76f1c146c6c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Booking form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "user_id": {
                                        "description": "Staff user ID; null applies the change at the form level",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "type_of_hours": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "same-host",
                                            "by-host"
                                        ]
                                    },
                                    "checked": {
                                        "description": "Whether public holidays should follow the same hours",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Booking form updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "booking_form": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Booking form updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Booking form not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/update-payment-status": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update an appointment's overall status",
                "description": "Sets the status field on an appointment without further validation. Use update-appointment-payment-status for the typed payment-status workflow.",
                "operationId": "327f7438022f98578761e4e56dfb44b9",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "appointment_id",
                                    "status"
                                ],
                                "properties": {
                                    "appointment_id": {
                                        "type": "integer"
                                    },
                                    "status": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Status updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Appointment not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking-management/update-appointment-payment-status": {
            "post": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Update an appointment's payment status",
                "description": "Sets payment_status to one of paid, pending, or failed. When transitioning a stripe-paid pending appointment to paid, also flags manual_stripe_payment=1.",
                "operationId": "5fd86e993f8620175ea0e29b23954f2a",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "appointment_id",
                                    "status"
                                ],
                                "properties": {
                                    "appointment_id": {
                                        "type": "integer"
                                    },
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "paid",
                                            "pending",
                                            "failed"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Payment status updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Payment status updated to Paid"
                                        },
                                        "data": {
                                            "description": "The updated appointment",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Appointment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Failed to update status."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-stripe-url-from-form-id/{formId}": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Build a Stripe Connect OAuth URL for a booking form",
                "description": "Returns a single-element array containing the Stripe OAuth authorization URL pre-populated with the form ID as state and the configured redirect URI / client ID. The caller redirects the user to that URL to authorize the connected account.",
                "operationId": "381ae47f1edee61855cc1899c08ad862",
                "parameters": [
                    {
                        "name": "formId",
                        "in": "path",
                        "description": "Booking form ID (passed back as the OAuth state parameter)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Single-element array containing the Stripe authorization URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking/{uuid}": {
            "get": {
                "tags": [
                    "Booking Form"
                ],
                "summary": "Get a public booking form by UUID",
                "description": "Public, unauthenticated endpoint used by the end-user booking page. Returns the booking form along with its services and staff (each annotated with a has_timeslot flag indicating whether the staff member has at least one working time slot).",
                "operationId": "a81822159637612a01605244a37e50fc",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "Public booking form UUID (the segment after /booking/ in the share URL)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Public booking form payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "booking_form": {
                                            "type": "object"
                                        },
                                        "services": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "staff": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Booking form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Booking form not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/brand-kit/extract": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Extract brand kit from a website URL with optional AI enhancement",
                "operationId": "0230df45f7213d6ceedf53a1fc1ee141",
                "parameters": [
                    {
                        "name": "url",
                        "in": "query",
                        "description": "Website URL to extract brand kit from",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    },
                    {
                        "name": "use_ai",
                        "in": "query",
                        "description": "Whether to enhance the extracted data with AI (defaults to true)",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit extracted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Brand kit extracted successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Insufficient AI credits"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/extract-raw": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Extract raw brand kit from a website URL without AI enhancement",
                "operationId": "0e823bdd8a0fd4cfad915b96f7889c59",
                "parameters": [
                    {
                        "name": "url",
                        "in": "query",
                        "description": "Website URL to extract brand kit from",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit extracted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Brand kit extracted successfully (Raw data)"
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "metadata": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/save": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Save (create or update) the authenticated client's brand kit",
                "operationId": "2740a58bdf0578d75b99ff11d208c1ac",
                "parameters": [
                    {
                        "name": "website_url",
                        "in": "query",
                        "description": "Website URL of the brand kit",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "business_details",
                        "in": "query",
                        "description": "Business details",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "logo",
                        "in": "query",
                        "description": "Logo URL",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "colors",
                        "in": "query",
                        "description": "Array of hex color codes",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "fonts",
                        "in": "query",
                        "description": "Array of font objects (name, type, size)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "is_verified",
                        "in": "query",
                        "description": "Whether the brand kit is verified",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit updated successfully"
                    },
                    "201": {
                        "description": "Brand kit created successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/process-and-save": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Process extracted brand kit data and save it to the database",
                "operationId": "345155a2bbe1a87d8b3e1be05283e21b",
                "parameters": [
                    {
                        "name": "website_url",
                        "in": "query",
                        "description": "Website URL of the brand kit",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    },
                    {
                        "name": "data",
                        "in": "query",
                        "description": "Extracted brand data to process",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit processed and updated successfully"
                    },
                    "201": {
                        "description": "Brand kit processed and created successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit": {
            "get": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "List brand kits for the authenticated user's client",
                "operationId": "d3c6d8e0ce1f4c9f289de3a6eca419cd",
                "responses": {
                    "200": {
                        "description": "Brand kits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/client/{clientId}": {
            "get": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Get brand kits for a specific client",
                "operationId": "9e54e43f7687fe6d2282d1c06e41d6ea",
                "parameters": [
                    {
                        "name": "clientId",
                        "in": "path",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kits retrieved successfully"
                    },
                    "403": {
                        "description": "Unauthorized access to this client"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/search": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Search brand kits for a client with filters and sorting",
                "operationId": "592d4618e94ff456330e875339cee837",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client (defaults to authenticated user's client)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Filter by company name (partial match)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "website_url",
                        "in": "query",
                        "description": "Filter by website URL (partial match)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_verified",
                        "in": "query",
                        "description": "Filter by verification status",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "created_by",
                        "in": "query",
                        "description": "Filter by creator user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "description": "Field to sort by",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "company_name",
                                "updated_at"
                            ]
                        }
                    },
                    {
                        "name": "sort_order",
                        "in": "query",
                        "description": "Sort order",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kits retrieved successfully"
                    },
                    "403": {
                        "description": "Unauthorized access to this client"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/admin/by-client": {
            "post": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Admin: get brand kits for a given client without client restriction",
                "operationId": "929da5507719db3379a552dcce97019c",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kits retrieved successfully"
                    },
                    "403": {
                        "description": "Admin access required"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/brand-kit/{id}": {
            "get": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Get a specific brand kit",
                "operationId": "934482e16e90467ec56b801c12232069",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the brand kit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit retrieved successfully"
                    },
                    "404": {
                        "description": "Brand kit not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Update a specific brand kit",
                "operationId": "3e14798c7654c262f9cb6109e41d9019",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the brand kit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "logo",
                        "in": "query",
                        "description": "Logo URL",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "colors",
                        "in": "query",
                        "description": "Array of hex color codes",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "fonts",
                        "in": "query",
                        "description": "Array of font objects (name, type, size)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "is_verified",
                        "in": "query",
                        "description": "Whether the brand kit is verified",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit updated successfully"
                    },
                    "404": {
                        "description": "Brand kit not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Brand Kit"
                ],
                "summary": "Delete a specific brand kit",
                "operationId": "61653fd1d9ac2d337b939d331834da9a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the brand kit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Brand kit deleted successfully"
                    },
                    "404": {
                        "description": "Brand kit not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/broadcasting/auth": {
            "get": {
                "tags": [
                    "Broadcasting"
                ],
                "summary": "Authenticate the current user for a private/presence broadcast channel",
                "description": "Laravel's built-in broadcast authentication endpoint used by Pusher/Reverb clients to authorize private and presence channel subscriptions.",
                "operationId": "b6d284c8c7a8b0cf40d441a8b0262bbd",
                "parameters": [
                    {
                        "name": "channel_name",
                        "in": "query",
                        "description": "Name of the private or presence channel the user is attempting to subscribe to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "private-team.1"
                        }
                    },
                    {
                        "name": "socket_id",
                        "in": "query",
                        "description": "Socket ID issued by the broadcaster client",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456.789"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Channel authentication payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "auth": {
                                            "type": "string",
                                            "example": "pusher_key:signature"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "User not authorized for the requested channel"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Broadcasting"
                ],
                "summary": "Authenticate the current user for a private/presence broadcast channel",
                "description": "Laravel's built-in broadcast authentication endpoint used by Pusher/Reverb clients to authorize private and presence channel subscriptions.",
                "operationId": "3e0f83ad7218e7b9135c5a764a7b4f41",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "required": [
                                    "channel_name",
                                    "socket_id"
                                ],
                                "properties": {
                                    "channel_name": {
                                        "type": "string",
                                        "example": "private-team.1"
                                    },
                                    "socket_id": {
                                        "type": "string",
                                        "example": "123456.789"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Channel authentication payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "auth": {
                                            "type": "string",
                                            "example": "pusher_key:signature"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "User not authorized for the requested channel"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-twilio-business-type": {
            "get": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Get Twilio business types and country names",
                "operationId": "50870ab6815a650deff240d9fd6ceac2",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "businessTypes": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "sid": {
                                                        "type": "string",
                                                        "example": "BU123456789"
                                                    },
                                                    "friendlyName": {
                                                        "type": "string",
                                                        "example": "Business"
                                                    },
                                                    "machineName": {
                                                        "type": "string",
                                                        "example": "business"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "countryName": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-bundle": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Create a new bundle",
                "operationId": "34ea6726ecb1693c1a5825bc15fa1f97",
                "parameters": [
                    {
                        "name": "bundle_name",
                        "in": "query",
                        "description": "Name of the bundle",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "My Bundle"
                        }
                    },
                    {
                        "name": "user_type",
                        "in": "query",
                        "description": "Type of user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "business"
                        }
                    },
                    {
                        "name": "country_name",
                        "in": "query",
                        "description": "Country code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "US"
                        }
                    },
                    {
                        "name": "number_type",
                        "in": "query",
                        "description": "Type of number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "local"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundle created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "bundle": {
                                            "type": "object"
                                        },
                                        "fieldArray": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-bundle-list": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Get list of bundles for the authenticated user's client",
                "operationId": "8560b71bb36401b76967121b826711d5",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "country_name": {
                                                        "type": "string",
                                                        "example": "United States"
                                                    },
                                                    "user_type": {
                                                        "type": "string",
                                                        "example": "business"
                                                    },
                                                    "number_type": {
                                                        "type": "string",
                                                        "example": "local"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "pending"
                                                    },
                                                    "friendly_name": {
                                                        "type": "string",
                                                        "example": "My Bundle"
                                                    },
                                                    "bundle_sid": {
                                                        "type": "string",
                                                        "example": "BU123456789"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-end-user": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Add or update end user information for a bundle",
                "operationId": "7f4e2634efff077ea4742fa7c759c9d2",
                "parameters": [
                    {
                        "name": "bundle_id",
                        "in": "query",
                        "description": "ID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "user_type",
                        "in": "query",
                        "description": "Type of user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "business"
                        }
                    },
                    {
                        "name": "address",
                        "in": "query",
                        "description": "Street address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123 Main St"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "New York"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State or region",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "NY"
                        }
                    },
                    {
                        "name": "postal_code",
                        "in": "query",
                        "description": "Postal code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "10001"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Country code",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "US"
                        }
                    },
                    {
                        "name": "comments",
                        "in": "query",
                        "description": "Additional comments",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Some comments"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "End user added or updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "end_user": {
                                            "type": "object"
                                        },
                                        "address": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/upload-document": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Upload a document and associate it with a bundle",
                "operationId": "86b89579ee3e443171730b6dcfb98c49",
                "parameters": [
                    {
                        "name": "document",
                        "in": "query",
                        "description": "Document file to upload (jpeg, png, pdf)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "document_type",
                        "in": "query",
                        "description": "Type of document",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "business_registration"
                        }
                    },
                    {
                        "name": "document_name",
                        "in": "query",
                        "description": "Name of the document",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Business Registration"
                        }
                    },
                    {
                        "name": "bundle_id",
                        "in": "query",
                        "description": "ID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "bundle_sid",
                        "in": "query",
                        "description": "SID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "BU123456789"
                        }
                    },
                    {
                        "name": "address_sids",
                        "in": "query",
                        "description": "SID of the address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "AD123456789"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Document uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "supported_document": {
                                            "type": "object"
                                        },
                                        "uploaded_documents_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/final-submit/{id}": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Submit a bundle for review",
                "operationId": "77871c88db7628702ccefdbfa7744c2c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "BU123456789"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundle submitted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "bundle": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong"
                                        },
                                        "errorArray": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/bundle-response": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Handle webhook responses from Twilio about bundle status changes",
                "operationId": "911b911bef6d62fe2d149a1ed80d4087",
                "parameters": [
                    {
                        "name": "BundleSid",
                        "in": "query",
                        "description": "SID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "BU123456789"
                        }
                    },
                    {
                        "name": "Status",
                        "in": "query",
                        "description": "Status of the bundle",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "approved"
                        }
                    },
                    {
                        "name": "FailureReason",
                        "in": "query",
                        "description": "Reason for failure if status is not approved",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Missing information"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-document": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Delete a document from a bundle",
                "operationId": "05db3da2050447d5ad50db8cf62cb926",
                "parameters": [
                    {
                        "name": "bundle_id",
                        "in": "query",
                        "description": "ID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "document_sid",
                        "in": "query",
                        "description": "SID of the document",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "SD123456789"
                        }
                    },
                    {
                        "name": "item_assigned_sid",
                        "in": "query",
                        "description": "SID of the item assignment",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "IA123456789"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Document deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "uploaded_documents_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bundle not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-bundle/{id}": {
            "delete": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Delete a bundle",
                "operationId": "30d1ebc10ec6e9c5ca3f129505fffbd9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundle deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Bundle deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bundle not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Bundle not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-bundle/{id}": {
            "get": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Get details of a bundle",
                "operationId": "fda3801bc8e565aa0f22336c2816551d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the bundle",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundle details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "bundle": {
                                            "type": "object"
                                        },
                                        "bundle_info": {
                                            "type": "object"
                                        },
                                        "bundle_doc": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "fieldArray": {
                                            "type": "object"
                                        },
                                        "countryName": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bundle not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Bundle not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/has-bundles": {
            "get": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Check whether the authenticated client has any bundles",
                "operationId": "d905d5106ed84c1f2617251c98f87210",
                "responses": {
                    "200": {
                        "description": "Bundle status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "has_bundles": {
                                            "type": "boolean"
                                        },
                                        "count": {
                                            "type": "integer"
                                        },
                                        "has_approved_bundle": {
                                            "type": "boolean"
                                        },
                                        "approved_bundle_types": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "latest_bundle_status": {
                                            "type": "string"
                                        },
                                        "latest_bundle_status_by_type": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-bundle-addresses": {
            "get": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Get unique list of bundle addresses for the authenticated client",
                "operationId": "e290a354bb2b5b3bcd40e756b2ff6f66",
                "responses": {
                    "200": {
                        "description": "Bundle addresses retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "addresses": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "sid": {
                                                        "type": "string"
                                                    },
                                                    "address": {
                                                        "type": "string"
                                                    },
                                                    "city": {
                                                        "type": "string"
                                                    },
                                                    "state": {
                                                        "type": "string"
                                                    },
                                                    "country": {
                                                        "type": "string"
                                                    },
                                                    "postal_code": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-bundle-address": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Update a bundle address on Twilio and locally",
                "operationId": "2d0dc1d867ded843510abe21235168d0",
                "parameters": [
                    {
                        "name": "sid",
                        "in": "query",
                        "description": "Twilio address SID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "address",
                        "in": "query",
                        "description": "Street address",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State or region",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "postal_code",
                        "in": "query",
                        "description": "Postal code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "ISO country code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundle address updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "address": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Address not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/reopen-bundle/{id}": {
            "post": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Reopen a Twilio-rejected bundle for editing and resubmission",
                "description": "Moves a bundle in \"twilio-rejected\" status back to \"draft\" on Twilio (edit and resubmit flow) so the assigned End-User and Supporting Documents can be corrected and resubmitted via final-submit. The stored failure_reason is kept so the rejection reason stays visible while editing.",
                "operationId": "380a90423fcb3033ea7d1120e40900fb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the bundle to reopen",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Result of the reopen attempt. success is false when the bundle does not exist for this client, is not in twilio-rejected status, or the Twilio update fails.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "bundle": {
                                            "description": "The updated bundle (status set to draft). Only present on success.",
                                            "type": "object"
                                        },
                                        "message": {
                                            "description": "Error message. Only present on failure (e.g. \"Identity not found\", \"Only a rejected identity can be edited and resubmitted.\")",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/bundle-number-types/{country}": {
            "get": {
                "tags": [
                    "Bundle"
                ],
                "summary": "Number types the identity wizard will create bundles for",
                "description": "Regulations-based (unlike /api/twilio-number-types/{country}, which is search-availability-based): the types the country's Twilio REGULATIONS define, minus the global blocklist — e.g. GB 03xx numbers sit in the \"Local\" search list but need a National bundle. Drives the wizard's step-1 informational note. Cached for a day; falls back to local+mobile when Twilio is unreachable.",
                "operationId": "1b61da4ccc6a5af55cb7dcb0896d2759",
                "parameters": [
                    {
                        "name": "country",
                        "in": "path",
                        "description": "ISO 3166-1 alpha-2 country code (e.g. GB)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GB"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Regulation number types",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "number_types": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "national"
                                            },
                                            "example": [
                                                "local",
                                                "mobile",
                                                "national"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/check-opt-service": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Check if user has any calendly events",
                "operationId": "749a9cdbd7e37598cd2325cd2903723c",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to check",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/add-default": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Add default calendly settings for user",
                "operationId": "072ad5b5ae244a483b1f9c3ef8e3cc1c",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to add default settings for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/get-all-user-calendly-events": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get all calendly events for authenticated user",
                "operationId": "7b670de572d86c22716be81671cd539f",
                "responses": {
                    "200": {
                        "description": "Success response with events data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/get-schedule": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get all calendly event schedules for authenticated user",
                "operationId": "d9ef5a1b6af3fcd31656f7fa7296a589",
                "responses": {
                    "200": {
                        "description": "Success response with event schedules",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event_schedules": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/add-user-event": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Add a new calendly event for user",
                "operationId": "cd832be9a18d67553908af833c957828",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Event title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Meeting with Client"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "Event location",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "person_meeting"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "description": "Event color",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 11
                        }
                    },
                    {
                        "name": "schedule_id",
                        "in": "query",
                        "description": "Schedule ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "number_of_future_days",
                        "in": "query",
                        "description": "Number of future days",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 30
                        }
                    },
                    {
                        "name": "meeting_duration",
                        "in": "query",
                        "description": "Meeting duration in minutes",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 30
                        }
                    },
                    {
                        "name": "is_custom_time",
                        "in": "query",
                        "description": "Is custom time",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    },
                    {
                        "name": "custom_time_type",
                        "in": "query",
                        "description": "Custom time type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "nullable": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/{id}": {
            "get": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get a specific calendly event",
                "operationId": "fe5260368644bbbbc31682dd0fe40ffe",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Calendly event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Update a calendly event",
                "operationId": "ec546f9c104b885ce89e9f6d0649bc7a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Calendly event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Event title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Meeting with Client"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "Event location",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "person_meeting"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "description": "Event color",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 11
                        }
                    },
                    {
                        "name": "schedule_id",
                        "in": "query",
                        "description": "Schedule ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "number_of_future_days",
                        "in": "query",
                        "description": "Number of future days",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 30
                        }
                    },
                    {
                        "name": "meeting_duration",
                        "in": "query",
                        "description": "Meeting duration in minutes",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 30
                        }
                    },
                    {
                        "name": "is_custom_time",
                        "in": "query",
                        "description": "Is custom time",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    },
                    {
                        "name": "custom_time_type",
                        "in": "query",
                        "description": "Custom time type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "nullable": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Delete a calendly event",
                "operationId": "b1fc9900f3f7308689e86d9fb96d81df",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Calendly event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_calendly_event_question/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get calendly event questions",
                "operationId": "46c8b41eddac0bd04dff91d991e86d9c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_calendly_event_reschedule_question/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get calendly event reschedule questions",
                "operationId": "23596fcfd1ac8fa00a00496cb58ec32b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/show_event_form_by_id_admin/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Show event form by ID for admin",
                "operationId": "06b6de001ea1eaac41d384cb799c86ae",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "client": {
                                            "type": "object"
                                        },
                                        "timeslots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/show_event_by_id/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Show event by ID",
                "operationId": "c10ea9d7fd75da845e87eed32830c3da",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "client": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/show_event_form_by_id/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Show event form by ID",
                "operationId": "94645c6706ac2b14289f332440242eea",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "client": {
                                            "type": "object"
                                        },
                                        "timeslots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-reschedule-in-calendly-event": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Reschedule form in calendly event",
                "operationId": "908831ce7e287570e77dd0c1e1d37c93",
                "parameters": [
                    {
                        "name": "event_id",
                        "in": "query",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "event_date",
                        "in": "query",
                        "description": "Event date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "event_time",
                        "in": "query",
                        "description": "Event time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "10:00"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event rescheduled successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-save-in-calendly-event": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Save form data in calendly event",
                "operationId": "4523d5eb1d1142f11eb3fb04cc9d8b50",
                "parameters": [
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "event_date",
                        "in": "query",
                        "description": "Event date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "event_time",
                        "in": "query",
                        "description": "Event time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "10:00"
                        }
                    },
                    {
                        "name": "form_data",
                        "in": "query",
                        "description": "Form data",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event scheduled successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/get-all-scheduled-events": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get all scheduled events for authenticated user",
                "operationId": "1de6d8979a262506b2f972aefb2e27b8",
                "responses": {
                    "200": {
                        "description": "Success response with scheduled events data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/schedule/{id}": {
            "get": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get a specific schedule data",
                "operationId": "011dfaa80c5b24633402a69713c763e3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Schedule ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "schedule": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Delete a schedule",
                "operationId": "1e5741c1a08ce1db4e4bcd829f1b16f7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Schedule ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Schedule deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_event_reschedule_timeslot/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get event reschedule timeslots",
                "operationId": "51ef5f4959347ca37c364968524f780f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "timeslots": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_event_reschedule_question/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Get event reschedule questions",
                "operationId": "a8b01e8ca8dd3b3cbd306ed53e67cc8a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-calendly-event/{id}": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Cancel a calendly event",
                "operationId": "526e87a5ec0c3355f4d277573f44cd4d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique event ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "abc123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Updated"
                                        },
                                        "organizer": {
                                            "type": "string",
                                            "example": "John Doe"
                                        },
                                        "event_name": {
                                            "type": "string",
                                            "example": "Meeting"
                                        },
                                        "event_time": {
                                            "type": "string",
                                            "example": "10:00-10:30 - Monday, 01 January 2023"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/reschedule-event": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Reschedule an event",
                "operationId": "c424abd78a33b1cd5b8875defa76c66d",
                "parameters": [
                    {
                        "name": "event_id",
                        "in": "query",
                        "description": "Event ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "event_date",
                        "in": "query",
                        "description": "Event date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "event_time",
                        "in": "query",
                        "description": "Event time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "10:00"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event rescheduled successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-calendly-auth": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Check Calendly connection status or exchange an OAuth code",
                "description": "With no stored token and no code, returns the Calendly OAuth link. With a code, exchanges it for tokens, stores them and registers a webhook. With a stored token, refreshes it if needed and returns the connected account email.",
                "operationId": "80e368e5d0ef2d3a7ad561dded36fa66",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "code": {
                                        "description": "Calendly OAuth authorization code to exchange for tokens",
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Connected (success true with calendar_email) or not connected (success false with auth_link and optional message)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "calendar_email": {
                                            "type": "string",
                                            "example": "user@example.com",
                                            "nullable": true
                                        },
                                        "auth_link": {
                                            "description": "Calendly OAuth login URL, present when not connected",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unable to obtain access token. Please re-authorize.",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/calendly/list": {
            "get": {
                "tags": [
                    "Calendly"
                ],
                "summary": "List Calendly scheduled events for the connected user in a date range",
                "operationId": "33fa4b5bdd6c57a639bd9e2f33be67d5",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Range start date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Range end date (must be on or after start_date)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2026-07-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Events list (success true) or re-authorization required (success false with auth_link)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "description": "Calendly event URI",
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Calendly Event"
                                                    },
                                                    "start": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "end": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "active"
                                                    },
                                                    "location": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "event_type": {
                                                        "type": "string",
                                                        "example": "calendly"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "colors": {
                                            "type": "object",
                                            "example": {
                                                "default": "#006bff"
                                            }
                                        },
                                        "auth_link": {
                                            "description": "Calendly OAuth login URL, present when re-authorization is required",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/calendly/logout": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Disconnect Calendly integration",
                "description": "Removes the Calendly webhook subscription (best-effort) and deletes the stored OAuth token for the authenticated user.",
                "operationId": "ee1889e81602c5a025e4725fa59027bc",
                "responses": {
                    "200": {
                        "description": "Success response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        },
                                        "auth_link": {
                                            "description": "Calendly OAuth login URL to reconnect",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/calendly/cancel": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Cancel a Calendly scheduled event by its URI",
                "operationId": "135946cf6b7f4d137376a43736f71ddf",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event_uri"
                                ],
                                "properties": {
                                    "event_uri": {
                                        "description": "Calendly scheduled event URI",
                                        "type": "string",
                                        "example": "https://api.calendly.com/scheduled_events/ABC123"
                                    },
                                    "reason": {
                                        "description": "Cancellation reason",
                                        "type": "string",
                                        "example": "Cancelled from Telagus",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event cancelled or re-authorization required (success false with auth_link)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event cancelled successfully.",
                                            "nullable": true
                                        },
                                        "auth_link": {
                                            "description": "Calendly OAuth login URL, present when re-authorization is required",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error response (Calendly API error or viewer role lacks permission to cancel)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly/webhook": {
            "post": {
                "tags": [
                    "Calendly"
                ],
                "summary": "Calendly webhook receiver (public, called by Calendly)",
                "description": "Public endpoint called by Calendly for invitee.created and invitee.canceled events. Not authenticated via bearer token; secured by verifying the Calendly-Webhook-Signature header (HMAC-SHA256). Creates or cancels the matching local calendar event.",
                "operationId": "f4f66f99e2db4a9bb0e39d450e003162",
                "parameters": [
                    {
                        "name": "Calendly-Webhook-Signature",
                        "in": "header",
                        "description": "Calendly signature header in the form \"t={timestamp},v1={hmac}\"",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "t=1625097600,v1=abc123"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "event": {
                                        "type": "string",
                                        "example": "invitee.created",
                                        "enum": [
                                            "invitee.created",
                                            "invitee.canceled"
                                        ]
                                    },
                                    "organization": {
                                        "description": "Calendly organization URI",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "payload": {
                                        "description": "Calendly invitee payload including the scheduled_event resource",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook processed (also returned for unknown accounts or non-actionable payloads)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid webhook signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid signature"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/calendly-schedule/get-all-user-calendly-schedules": {
            "post": {
                "tags": [
                    "Calendly Schedule"
                ],
                "summary": "Get all calendly event schedules for the authenticated user",
                "operationId": "1955de4bfa78414f41bff19fd2447c3b",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly-schedule/add-user-schedule": {
            "post": {
                "tags": [
                    "Calendly Schedule"
                ],
                "summary": "Add a new calendly schedule for the authenticated user",
                "operationId": "02b3228b4fcc2907e0800fdd324d19d9",
                "parameters": [
                    {
                        "name": "scheduleTitle",
                        "in": "query",
                        "description": "Title of the schedule",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "My Schedule"
                        }
                    },
                    {
                        "name": "weekdayselected",
                        "in": "query",
                        "description": "Array of selected weekdays (0-6 for Monday-Sunday)",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "startdates",
                        "in": "query",
                        "description": "Array of start times for each weekday",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "time",
                                "example": "09:00"
                            }
                        }
                    },
                    {
                        "name": "enddates",
                        "in": "query",
                        "description": "Array of end times for each weekday",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "time",
                                "example": "17:00"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event_schedule": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendly-schedule/{id}": {
            "get": {
                "tags": [
                    "Calendly Schedule"
                ],
                "summary": "Get a specific calendly schedule by ID",
                "operationId": "a41c4088c62211becbc803f9b86635e3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the schedule to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event_schedule": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Schedule not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Calendly Schedule"
                ],
                "summary": "Update an existing calendly schedule",
                "operationId": "9cef9bf98f731f70f7389ade00ee2076",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the schedule to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "scheduleTitle",
                        "in": "query",
                        "description": "Title of the schedule",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "My Updated Schedule"
                        }
                    },
                    {
                        "name": "weekdayselected",
                        "in": "query",
                        "description": "Array of selected weekdays (0-6 for Monday-Sunday)",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "startdates",
                        "in": "query",
                        "description": "Array of start times for each weekday",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "time",
                                "example": "09:00"
                            }
                        }
                    },
                    {
                        "name": "enddates",
                        "in": "query",
                        "description": "Array of end times for each weekday",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "time",
                                "example": "17:00"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event_schedule": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Schedule not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Calendly Schedule"
                ],
                "summary": "Delete a calendly schedule",
                "operationId": "1dec94af17f078a8d1d2fd917c149368",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the schedule to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Schedule Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Schedule not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-device-access-token": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get Twilio access token for voice calls",
                "operationId": "f3a1c22ecb7560b4df5522e2a4069b85",
                "responses": {
                    "200": {
                        "description": "Access token generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "token": {
                                            "type": "string",
                                            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/device-registered/{id}": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Register a device for Twilio calls",
                "operationId": "bedb4512ca8bb86cfa99b1da1445d6f7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID to register the device for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device registered successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data updated..!"
                                        },
                                        "phone_number": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Registration failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not updated..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/request-voice-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Process a voice call request through Twilio",
                "description": "Handles both incoming and outgoing call requests and logs call details",
                "operationId": "1a01c005dca03e28b41bf60644c6a886",
                "parameters": [
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Twilio Call SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Status of the call",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "queued",
                                "ringing",
                                "in-progress",
                                "completed",
                                "busy",
                                "failed",
                                "no-answer",
                                "canceled"
                            ]
                        }
                    },
                    {
                        "name": "LeadId",
                        "in": "query",
                        "description": "ID of the lead associated with the call",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fromCallerId",
                        "in": "query",
                        "description": "ID of the caller",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "toCallerId",
                        "in": "query",
                        "description": "ID of the call recipient",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Phone number the call is from",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Phone number the call is to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "AccountSid",
                        "in": "query",
                        "description": "Twilio Account SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ApplicationSid",
                        "in": "query",
                        "description": "Twilio Application SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call request processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Call request processed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-response": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Handle Twilio call status callback",
                "description": "Processes Twilio call status updates and records call details",
                "operationId": "54872988c7ce541fe28dbf60d5a27cfa",
                "parameters": [
                    {
                        "name": "ParentCallSid",
                        "in": "query",
                        "description": "Parent Call SID from Twilio",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Call SID from Twilio",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Status of the call",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "queued",
                                "ringing",
                                "in-progress",
                                "completed",
                                "busy",
                                "failed",
                                "no-answer",
                                "canceled"
                            ]
                        }
                    },
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Phone number the call is from",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "RecordingUrl",
                        "in": "query",
                        "description": "URL of the call recording",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "RecordingSid",
                        "in": "query",
                        "description": "SID of the call recording",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "RecordingDuration",
                        "in": "query",
                        "description": "Duration of the recording in seconds",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "CallDuration",
                        "in": "query",
                        "description": "Duration of the call in seconds",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "ToCountry",
                        "in": "query",
                        "description": "Country code of the call recipient",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ToState",
                        "in": "query",
                        "description": "State of the call recipient",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallerCountry",
                        "in": "query",
                        "description": "Country code of the caller",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallerState",
                        "in": "query",
                        "description": "State of the caller",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Timestamp",
                        "in": "query",
                        "description": "Timestamp of the call",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call status processed successfully"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get call logs for a specific lead",
                "operationId": "1f6430e562c241f56d38f59990f219b7",
                "parameters": [
                    {
                        "name": "leadId",
                        "in": "query",
                        "description": "ID of the lead to get call logs for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call logs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leadCallLog": {
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "lead_call_id": {
                                                                "type": "integer"
                                                            },
                                                            "call_sid": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "recording_url": {
                                                                "type": "string"
                                                            },
                                                            "call_status": {
                                                                "type": "string"
                                                            },
                                                            "call_duration": {
                                                                "type": "string"
                                                            },
                                                            "notes": {
                                                                "type": "string"
                                                            },
                                                            "contact_name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "draw": {
                                                    "type": "integer"
                                                },
                                                "recordsFiltered": {
                                                    "type": "integer"
                                                },
                                                "recordsTotal": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        },
                                        "virtualNumberCount": {
                                            "type": "integer"
                                        },
                                        "virtualNumber": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Call logs not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-incoming-call-lead-name/{id}": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get the lead name associated with an incoming call phone number",
                "operationId": "13c299c23087483312e54ad3f70abd3f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Incoming caller phone number to match against lead contacts",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_data": {
                                            "properties": {
                                                "lead_name": {
                                                    "type": "string"
                                                },
                                                "lead_id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found for the given phone number"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-device-active-status": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Update the active status timestamp of the authenticated user's call device",
                "operationId": "1ab06346a86bf76a973bc124d4fbe043",
                "parameters": [
                    {
                        "name": "device_identity",
                        "in": "query",
                        "description": "Specific device identity to update",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "device_type",
                        "in": "query",
                        "description": "Device type when no identity is provided (defaults to web)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "web"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device active status updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/accept-push-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Accept or reject an incoming push-notification call on mobile",
                "description": "Used when the mobile app was killed and the user taps Accept/Reject on the native call notification.",
                "operationId": "2a924b84dacfeea0fad977a8fea4c2af",
                "parameters": [
                    {
                        "name": "call_sid",
                        "in": "query",
                        "description": "Twilio call SID identifying the incoming call",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "description": "Action to perform: accept (default) or reject",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "accept",
                            "enum": [
                                "accept",
                                "reject"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Push call action processed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "call_sid is required"
                    },
                    "500": {
                        "description": "Twilio not configured or server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get all call logs as a DataTables response",
                "operationId": "1659a8ba1585d1956441c6fee9fe7b32",
                "parameters": [
                    {
                        "name": "filter_by_call_direction",
                        "in": "query",
                        "description": "Filter call logs by direction (inbound, outbound)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call logs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "allCallList": {
                                            "type": "object"
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        },
                                        "allow_postpaid_call": {
                                            "type": "integer"
                                        },
                                        "plan_status": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/download-call-recording/{id}": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Download a call recording",
                "description": "Streams the Twilio recording for a call log back as an MP3 attachment. Requires the same All Call Logs / Own Call Logs access as the call list.",
                "operationId": "a8bc8204ff72f35057911769f546a633",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead call log ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Recording streamed as an audio/mpeg attachment",
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "User may not access this call log",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Call log not found or recording unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Recording could not be fetched from Twilio",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-list-mobile": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get paginated call logs for the mobile app",
                "operationId": "ba97df0c31ca6c5d0dba5eef41bc92aa",
                "parameters": [
                    {
                        "name": "filter_by_call_direction",
                        "in": "query",
                        "description": "Filter call logs by direction (inbound, outbound)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "keyword",
                        "in": "query",
                        "description": "Search keyword to filter by contact name or phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (defaults to 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Items per page (defaults to 15)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 15
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated call logs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "callList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        },
                                        "allow_postpaid_call": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twilio-device-unregister/{id}": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Unregister a user's Twilio call device(s)",
                "operationId": "4a0f19605db9a06595f35b1ebc265009",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID whose device(s) should be unregistered",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "device_identity",
                        "in": "query",
                        "description": "Specific device identity to unregister (otherwise all of the user's devices are unregistered)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device(s) unregistered successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sip-voice-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Twilio voice webhook for SIP desk-phone calls (inbound and outbound)",
                "description": "Public Twilio webhook (no authentication). Point both the SIP Domain \"A CALL COMES IN\" webhook and the Twilio number's Voice webhook here. Direction is decided from the From value: a sip: URI means the desk phone dialed out (outbound PSTN call), a normal phone number means an inbound call that rings the registered SIP device. The call is logged so the call-response callback can update its status later. Always responds with TwiML XML.",
                "operationId": "39a5d7a8919077a6303aa8390b58d2f4",
                "parameters": [
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Caller: a SIP URI (sip:user@domain) for outbound desk-phone calls, or a phone number for inbound calls",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "sip:scaff_inspector@scaff-inspector.sip.twilio.com"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Dialed destination: the dialed number (possibly as a SIP URI) for outbound calls, or the Twilio number for inbound calls",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "+441234567890"
                        }
                    },
                    {
                        "name": "CallSid",
                        "in": "query",
                        "description": "Twilio Call SID; when present a lead_call_logs row is created/updated",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "AccountSid",
                        "in": "query",
                        "description": "Twilio Account SID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "CallStatus",
                        "in": "query",
                        "description": "Status of the call",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "queued",
                                "ringing",
                                "in-progress",
                                "completed",
                                "busy",
                                "failed",
                                "no-answer",
                                "canceled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TwiML voice instructions (always 200, even on internal errors, so Twilio can play a spoken error message)",
                        "content": {
                            "text/xml": {
                                "schema": {
                                    "type": "string",
                                    "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Dial answerOnBridge=\"true\" record=\"record-from-answer\"><Number>+441234567890</Number></Dial></Response>"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/calls/reports/filter-options": {
            "get": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Salespeople list for the report's multi-select filter",
                "operationId": "714a31e14e85ab7ade7eaf39b9477714",
                "responses": {
                    "200": {
                        "description": "Users of the authenticated client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 42
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/summary": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "KPI band: call totals, answer rate, talk time and previous-period growth",
                "operationId": "dd4862a61c95d446a4075533947872d7",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Aggregates for the period, plus the immediately preceding period of equal length when a date range was given",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/CallReportAggregates"
                                        },
                                        {
                                            "properties": {
                                                "previous": {
                                                    "description": "Aggregates for the previous period; null when no date range was selected",
                                                    "nullable": true,
                                                    "allOf": [
                                                        {
                                                            "$ref": "#/components/schemas/CallReportAggregates"
                                                        }
                                                    ]
                                                },
                                                "growth_percentage": {
                                                    "description": "Total-calls growth vs the previous period, as a percentage; null when no date range was selected",
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 12.5,
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/by-hour": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Calls per hour of day (client timezone) — total vs connected",
                "operationId": "d9b5ff5471912c5b4b7d0bf9de05b0df",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Three parallel 24-entry arrays, one per hour 00:00–23:00",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "labels": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "09:00"
                                            }
                                        },
                                        "total": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        },
                                        "connected": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/by-day": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Calls per calendar day (client timezone) — total vs connected",
                "operationId": "742306f73aafc5a419aee8a6684cee4e",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Parallel arrays with one entry per day that had calls, in date order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "labels": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "14 Aug"
                                            }
                                        },
                                        "total": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        },
                                        "connected": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/by-salesperson": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Per-salesperson call KPIs with revenue collected on their leads",
                "description": "Revenue is the value of quotes accepted in the window (net of discounts) on leads assigned to each salesperson.",
                "operationId": "00ff3299b473dd85f165b3b1dca05eba",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "One row per salesperson, ordered by calls descending",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "full_name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    },
                                                    "calls": {
                                                        "type": "integer"
                                                    },
                                                    "connected": {
                                                        "type": "integer"
                                                    },
                                                    "answer_rate": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "talk_time_seconds": {
                                                        "type": "integer"
                                                    },
                                                    "avg_duration_seconds": {
                                                        "type": "integer"
                                                    },
                                                    "revenue": {
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/funnel": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Sales funnel for the leads dialled in the window",
                "description": "Stages: Outbound Calls → Conversations → Leads Reached → Meetings Booked → Quotes Sent → Won. The final stage honours the client's conversion_ratio setting: label \"Quote Accepted\" in quote_acceptance mode, otherwise \"Won (<position>)\" for the configured lead position.",
                "operationId": "4af51bf572e679c8116b4f415264987b",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Funnel stages in order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "stage": {
                                                        "type": "string",
                                                        "example": "Conversations"
                                                    },
                                                    "count": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "conversion_mode": {
                                            "description": "The client's conversion_ratio mode driving the final stage",
                                            "type": "string",
                                            "example": "convert_to_other_lead_position"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/revenue": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Revenue tiles: collected revenue, per-call/per-conversation rates and open pipeline",
                "description": "Revenue is from quotes accepted in the window (same basis as the dashboard revenue widget) on leads assigned to the selected salespeople; pipeline is the open (not-won) value of the leads dialled.",
                "operationId": "8662a150a89350153af9934a039a1da8",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Revenue metrics for the period",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "revenue_collected": {
                                            "type": "number",
                                            "format": "float",
                                            "example": 12500
                                        },
                                        "revenue_per_call": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "revenue_per_conversation": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "accepted_quotes": {
                                            "type": "integer"
                                        },
                                        "avg_deal_size": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "pipeline_value": {
                                            "type": "number",
                                            "format": "float"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/follow-up": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Follow-up effectiveness for the leads dialled in the window",
                "description": "Touches are gathered across calls, campaign emails, SMS, notes and meetings. A lead counts as abandoned when it is not won and has had no touch in the last 14 days; overdue follow-ups are incomplete lead tasks whose due date fell inside the window and has passed.",
                "operationId": "496e0a9525db0fa4f1fdb9044a635998",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Follow-up metrics (zeroed shape with no leads in the window)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "total_leads": {
                                            "type": "integer"
                                        },
                                        "avg_touches_per_lead": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "avg_days_between_contacts": {
                                            "description": "Mean gap in days between consecutive touches; null when no lead has 2+ touches",
                                            "type": "number",
                                            "format": "float",
                                            "nullable": true
                                        },
                                        "avg_touches_before_won": {
                                            "description": "Average touches on won leads; null when none won",
                                            "type": "number",
                                            "format": "float",
                                            "nullable": true
                                        },
                                        "leads_abandoned": {
                                            "type": "integer"
                                        },
                                        "overdue_followups": {
                                            "type": "integer"
                                        },
                                        "touch_breakdown": {
                                            "properties": {
                                                "calls": {
                                                    "type": "integer"
                                                },
                                                "emails": {
                                                    "type": "integer"
                                                },
                                                "sms": {
                                                    "type": "integer"
                                                },
                                                "notes": {
                                                    "type": "integer"
                                                },
                                                "meetings": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/productivity": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Attendance-based productivity per salesperson plus a team roll-up",
                "description": "Logged-in time comes from attendance sessions in the window (open sessions counted up to now); selling_time_ratio is the share of logged-in time spent talking, as a percentage.",
                "operationId": "19467664dc5c120cbcfd8efe9ff64581",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-user rows ordered by calls descending, plus team totals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "full_name": {
                                                        "type": "string"
                                                    },
                                                    "calls": {
                                                        "type": "integer"
                                                    },
                                                    "logged_in_seconds": {
                                                        "type": "integer"
                                                    },
                                                    "talk_time_seconds": {
                                                        "type": "integer"
                                                    },
                                                    "calls_per_hour": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "selling_time_ratio": {
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "team": {
                                            "properties": {
                                                "calls": {
                                                    "type": "integer"
                                                },
                                                "logged_in_seconds": {
                                                    "type": "integer"
                                                },
                                                "talk_time_seconds": {
                                                    "type": "integer"
                                                },
                                                "calls_per_hour": {
                                                    "type": "number",
                                                    "format": "float"
                                                },
                                                "selling_time_ratio": {
                                                    "type": "number",
                                                    "format": "float"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/leaderboard": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Salesperson leaderboard ranked by a chosen metric",
                "operationId": "109ad1f2da7f378ce59f954b03392d93",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/CallReportFilters"
                                    },
                                    {
                                        "properties": {
                                            "sort_by": {
                                                "description": "Metric to rank by; invalid or missing values fall back to calls",
                                                "type": "string",
                                                "example": "revenue",
                                                "nullable": true,
                                                "enum": [
                                                    "calls",
                                                    "conversations",
                                                    "meetings",
                                                    "revenue",
                                                    "answer_rate"
                                                ]
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Ranked rows and the sort metric actually applied",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "full_name": {
                                                        "type": "string"
                                                    },
                                                    "calls": {
                                                        "type": "integer"
                                                    },
                                                    "conversations": {
                                                        "description": "Connected calls",
                                                        "type": "integer"
                                                    },
                                                    "meetings": {
                                                        "description": "Meetings booked (non-cancelled events owned by the user)",
                                                        "type": "integer"
                                                    },
                                                    "revenue": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "answer_rate": {
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "sort_by": {
                                            "type": "string",
                                            "example": "calls"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/executive": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Executive snapshot: today's live activity, outcomes and forecast",
                "description": "Live and outcome metrics are always scoped to today (client timezone) regardless of the filter dates; pipeline_value reflects open leads created within the selected report period, and forecast_revenue applies the 90-day historical close rate to that pipeline.",
                "operationId": "091f216b0ff41e5027e6024ca3e69a7d",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CallReportFilters"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Executive metrics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "calls_today": {
                                            "type": "integer"
                                        },
                                        "connected_today": {
                                            "type": "integer"
                                        },
                                        "connection_rate_today": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "live_callers": {
                                            "description": "Users with an assigned phone number and a registered Twilio device right now",
                                            "type": "integer"
                                        },
                                        "active_conversations": {
                                            "description": "Calls currently in-progress today",
                                            "type": "integer"
                                        },
                                        "meetings_today": {
                                            "type": "integer"
                                        },
                                        "quotes_today": {
                                            "description": "Quotes sent today",
                                            "type": "integer"
                                        },
                                        "sales_won_today": {
                                            "type": "integer"
                                        },
                                        "revenue_today": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "best_performer": {
                                            "description": "Top caller today by call count; null when no calls yet",
                                            "properties": {
                                                "full_name": {
                                                    "type": "string"
                                                },
                                                "calls": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object",
                                            "nullable": true
                                        },
                                        "pipeline_value": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "forecast_revenue": {
                                            "description": "pipeline_value × 90-day close rate",
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "close_rate": {
                                            "description": "90-day close rate as a percentage",
                                            "type": "number",
                                            "format": "float"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calls/reports/drilldown": {
            "post": {
                "tags": [
                    "Call Reports"
                ],
                "summary": "Drill-down rows behind an activity tile",
                "description": "metric selects what to list: \"calls\" (default) and \"connected\" return call rows (connected = completed calls only); \"leads\" returns the distinct leads dialled, each row shaped as {lead_id, lead_name, calls, last_called_at}. Rows are capped at 500 — truncated flags when the true total exceeds the cap.",
                "operationId": "5fe6209d0ea4542a0c54277e74a3a843",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/CallReportFilters"
                                    },
                                    {
                                        "properties": {
                                            "metric": {
                                                "description": "Which records to list; invalid or missing values fall back to calls",
                                                "type": "string",
                                                "example": "calls",
                                                "nullable": true,
                                                "enum": [
                                                    "calls",
                                                    "connected",
                                                    "leads"
                                                ]
                                            }
                                        },
                                        "type": "object"
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Row list (call-row shape shown; see description for the leads shape)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "metric": {
                                            "type": "string",
                                            "example": "calls"
                                        },
                                        "total": {
                                            "description": "True total before the cap",
                                            "type": "integer"
                                        },
                                        "truncated": {
                                            "type": "boolean"
                                        },
                                        "rows": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "created_at": {
                                                        "description": "Call time in the client timezone",
                                                        "type": "string"
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "lead_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "from": {
                                                        "type": "string"
                                                    },
                                                    "to": {
                                                        "type": "string"
                                                    },
                                                    "call_status": {
                                                        "type": "string",
                                                        "example": "completed"
                                                    },
                                                    "call_duration": {
                                                        "type": "integer"
                                                    },
                                                    "recording_url": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "in_recording_deleted": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CallReportError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get list of calls for the authenticated user's current site",
                "description": "Fetches paginated call tracking data with optional filters for date, call channel, and length.",
                "operationId": "getCallsList",
                "parameters": [
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Pagination start offset (used to calculate page number)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 10,
                            "default": 10
                        }
                    },
                    {
                        "name": "date[created_at][]",
                        "in": "query",
                        "description": "Filter calls by created date or date range. Pass one date or two dates for range",
                        "required": false,
                        "style": "form",
                        "explode": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-05-01"
                        }
                    },
                    {
                        "name": "date_between[created_at][0][0]",
                        "in": "query",
                        "description": "Start date for nested date range filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-05-01"
                        }
                    },
                    {
                        "name": "date_between[created_at][0][1]",
                        "in": "query",
                        "description": "End date for nested date range filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-05-10"
                        }
                    },
                    {
                        "name": "is_equal_to[call_channel][]",
                        "in": "query",
                        "description": "Filter by call channel, pass array with one value",
                        "required": false,
                        "style": "form",
                        "explode": true,
                        "schema": {
                            "type": "string",
                            "example": "web"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with calls data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "current_page": {
                                            "type": "integer"
                                        },
                                        "last_page": {
                                            "type": "integer"
                                        },
                                        "per_page": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - user not logged in"
                    },
                    "500": {
                        "description": "Server error or API failure"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/auth-link": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get OAuth2 authorization link for Google Ads",
                "description": "Generates and returns the OAuth2 authorization URL for Google Ads API access. Public endpoint — registered with withoutMiddleware('auth:api') in routes/api.php.",
                "operationId": "getCalltrackingAuthLink",
                "responses": {
                    "200": {
                        "description": "Authorization link generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "format": "url",
                                            "example": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent&client_id=your-client-id&redirect_uri=your-redirect-uri&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/call-tracking/login": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Login to Call Tracking system",
                "description": "Logs in a user to the Call Tracking system and stores the access token.",
                "operationId": "login",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "User's password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "password123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Logged in successfully."
                                        },
                                        "sites": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid login credentials"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/select-site": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Fetch available call tracking sites",
                "description": "Retrieves a list of sites associated with the authenticated user's access token. Supports filtering by date or date range.",
                "operationId": "selectSites",
                "parameters": [
                    {
                        "name": "date[created_at][]",
                        "in": "query",
                        "description": "Single date or start date for filtering site data",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-05-01"
                        }
                    },
                    {
                        "name": "date[created_at][1]",
                        "in": "query",
                        "description": "End date if using a date range",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-05-10"
                        }
                    },
                    {
                        "name": "date_between[created_at][0][0]",
                        "in": "query",
                        "description": "Start date for nested date range filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-04-01"
                        }
                    },
                    {
                        "name": "date_between[created_at][0][1]",
                        "in": "query",
                        "description": "End date for nested date range filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-04-30"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful retrieval of sites",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/set-current-site": {
            "put": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Set the current site for the authenticated user",
                "description": "Updates the current site in the user's call tracking session and reflects the change via an API call to the external tracking service.",
                "operationId": "setCurrentSite",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "site_id"
                                ],
                                "properties": {
                                    "site_id": {
                                        "type": "integer",
                                        "example": 123
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Current site successfully updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Current site updated"
                                        },
                                        "content": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized or no call tracking session found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/view": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "View details of a specific call",
                "description": "Retrieve call details by call ID for the authenticated user.",
                "operationId": "callView",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Call ID to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 12345
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 12345
                                        },
                                        "dt_created": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2025-05-19T12:34:56Z"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/visitor": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get visitor and call details by visitor ID",
                "description": "Fetches visitor info including visits and calls for the given visitor ID.",
                "operationId": "callVisitor",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Visitor ID to fetch the details for",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "visitor_123abc"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Visitor and calls data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "visits": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "dt_created": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-19T12:34:56Z"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "calls": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "dt_created": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-19T12:34:56Z"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or bad request"
                    },
                    "401": {
                        "description": "Unauthorized - user not logged in or invalid token"
                    },
                    "500": {
                        "description": "Server error or exception"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/download": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Download call recording file by call ID",
                "description": "Downloads the audio recording file for the specified call ID.",
                "operationId": "callDownload",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the call to download the recording for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 12345
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download response",
                        "content": {
                            "application/octet-stream": {}
                        }
                    },
                    "400": {
                        "description": "Validation error or bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Error downloading file."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - user not logged in or invalid token"
                    },
                    "404": {
                        "description": "No file found for the given call ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No file found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error or exception"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/get-audio-url": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get audio URL of a call",
                "description": "Retrieve the audio URL for a call by ID",
                "operationId": "callGetAudioURL",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the call",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 12345
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audio URL retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "audio_url": {
                                            "type": "string",
                                            "format": "url",
                                            "example": "https://example.com/audio/12345.mp3"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/update-note": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Update note for a specific call",
                "description": "Allows the authenticated user to update the note associated with a call by call ID.",
                "operationId": "callUpdateNote",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "call_id",
                                    "note"
                                ],
                                "properties": {
                                    "call_id": {
                                        "description": "ID of the call to update",
                                        "type": "integer",
                                        "example": 12345
                                    },
                                    "note": {
                                        "description": "New note content",
                                        "type": "string",
                                        "example": "Followed up with client, left voicemail."
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Note updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Note updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The call_id field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - user not logged in or invalid token"
                    },
                    "500": {
                        "description": "Server error or invalid request"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/update-status": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Update the status of a call",
                "operationId": "callUpdateStatus",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "required": [
                                    "call_id",
                                    "status"
                                ],
                                "properties": {
                                    "call_id": {
                                        "description": "ID of the call",
                                        "type": "integer",
                                        "example": 12345
                                    },
                                    "status": {
                                        "description": "New status for the call",
                                        "type": "string",
                                        "example": "completed"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Status updated"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/channel-wise-call-count/{id}": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get call count grouped by channel",
                "description": "Fetches the count of calls per channel for a given site. The {id} path segment is the TelsaLeads site_id — the controller's signature is channelWiseCallCount($id) and the value is forwarded as site_id to TelsaLeads' /call/channel-wise-call-count.",
                "operationId": "channelWiseCallCount",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "TelsaLeads site ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call count data fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "site": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/get-monthly-call-count": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get total call count for the current month",
                "description": "Retrieves the total number of calls for the current month for a given site. Side effect: persists the supplied site_id as the user's current_site on the CallTracking row.",
                "operationId": "getMonthlyCallCount",
                "parameters": [
                    {
                        "name": "site_id",
                        "in": "query",
                        "description": "ID of the site to get call data for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Monthly call count fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "calls found"
                                        },
                                        "call_count": {
                                            "type": "integer",
                                            "example": 45
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking-keyword-statistics/{id}": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get keyword statistics for a site",
                "description": "Fetches keyword call statistics for the given site ID",
                "operationId": "keywordStatistics",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Site ID to get keyword statistics for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with keyword statistics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "calls found"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "date": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2025-05-19T00:00:00Z"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid site ID supplied"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error or invalid API response"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/create-lead": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Create a new lead (from a Call Tracking record)",
                "description": "Creates a new lead with associated contact and company information. If a lead with the same mobile number and source exists, it returns the existing lead ID.",
                "operationId": "createLead",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "lead",
                                    "lead_contact",
                                    "lead_company"
                                ],
                                "properties": {
                                    "lead": {
                                        "required": [
                                            "lead_source",
                                            "lead_position_id"
                                        ],
                                        "properties": {
                                            "lead_source": {
                                                "type": "string",
                                                "example": "website"
                                            },
                                            "lead_position_id": {
                                                "type": "integer",
                                                "example": 1
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "lead_contact": {
                                        "required": [
                                            "first_name",
                                            "email",
                                            "mobile_number"
                                        ],
                                        "properties": {
                                            "first_name": {
                                                "type": "string",
                                                "example": "John"
                                            },
                                            "email": {
                                                "type": "string",
                                                "example": "john@example.com"
                                            },
                                            "mobile_number": {
                                                "type": "string",
                                                "example": "9876543210"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "lead_company": {
                                        "required": [
                                            "company_name"
                                        ],
                                        "properties": {
                                            "company_name": {
                                                "type": "string",
                                                "example": "Acme Corp"
                                            }
                                        },
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Lead created or already exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Successfully Created"
                                        },
                                        "created_lead_id": {
                                            "type": "integer",
                                            "example": 101
                                        },
                                        "already_exist_lead_id": {
                                            "type": "integer",
                                            "example": 95
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/auth-callback": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Complete the Google Ads OAuth flow",
                "description": "Exchanges the Google OAuth authorization `code` for tokens, decodes the id_token to capture the Gmail address, and persists a GoogleAdsToken row for the authenticated user. Called after the user authorizes via the URL returned from /api/call-tracking/auth-link.",
                "operationId": "14d62bfc54a88e0846b6415aca6a2cc9",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by Google to the redirect_uri",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token exchange successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "authToken": {
                                            "description": "Raw Google auth-token payload — includes access_token, refresh_token, id_token, expires_in",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "code missing"
                    },
                    "500": {
                        "description": "Token exchange failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/store-ads-token": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Register a Google Ads token with the TelsaLeads service",
                "description": "Forwards the user's stored Google Ads access token plus a Google Ads customer ID hierarchy and a TelsaLeads site ID to TelsaLeads' /call/store-ad-token endpoint. Requires a prior successful /api/call-tracking/login (so the user's client has a TelsaLeads access_token) AND a prior /api/call-tracking/auth-callback (so GoogleAdsToken row exists).",
                "operationId": "30ccd0e61912a76f35ff2b31a9f39571",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "st_client_id",
                                    "st_parent_client_id",
                                    "in_site_id"
                                ],
                                "properties": {
                                    "st_client_id": {
                                        "description": "Google Ads child/sub-account customer ID",
                                        "type": "string"
                                    },
                                    "st_parent_client_id": {
                                        "description": "Google Ads manager/parent account customer ID",
                                        "type": "string"
                                    },
                                    "in_site_id": {
                                        "description": "TelsaLeads site ID to associate the token with",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Token stored on TelsaLeads. Returns either the success envelope or the upstream response on failure.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Ads token stored successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/get-ads-token": {
            "get": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Get the user's stored Google Ads token state",
                "description": "Asks TelsaLeads for the currently-registered ad-token info (/call/get-ad-token) and augments it with the gmail address from the local GoogleAdsToken row.",
                "operationId": "b03380cfe7adea17a1327fefeae3d6be",
                "responses": {
                    "200": {
                        "description": "Ads token info",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "content": {
                                            "description": "Verbatim TelsaLeads /call/get-ad-token response",
                                            "type": "object"
                                        },
                                        "gmail_email": {
                                            "description": "Gmail address from the local GoogleAdsToken row; empty string when no row exists",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/remove-ads-token": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Remove a Google Ads token registration on TelsaLeads",
                "description": "Forwards a delete request to TelsaLeads' /call/remove-ad-token for the given (st_client_id, in_site_id) pair.",
                "operationId": "a1cb6895fb0fff92eeeff5246ce893eb",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "st_client_id",
                                    "in_site_id"
                                ],
                                "properties": {
                                    "st_client_id": {
                                        "description": "Google Ads customer ID to remove",
                                        "type": "string"
                                    },
                                    "in_site_id": {
                                        "description": "TelsaLeads site ID the token is associated with",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Token removed (or upstream response forwarded)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Ads token removed successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking/create-site": {
            "post": {
                "tags": [
                    "Call Tracking"
                ],
                "summary": "Create a new tracking site on TelsaLeads",
                "description": "Calls TelsaLeads' /site/create with the supplied site_name and site_url (mapped to st_site_name / st_site_url). The controller reads the fields with no validation — both are passed through as-is, missing values get sent as null.",
                "operationId": "31c76a02503a06375dd46d7adf72b5ee",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "site_name": {
                                        "description": "Site display name (forwarded to TelsaLeads as st_site_name)",
                                        "type": "string"
                                    },
                                    "site_url": {
                                        "description": "Site URL (forwarded as st_site_url)",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Always 200 by handler convention — inspect the `success` flag to distinguish create-success from upstream rejection. On rejection, `error` is also populated.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "description": "true on create, false on upstream rejection",
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "description": "Present on success",
                                            "type": "object",
                                            "nullable": true
                                        },
                                        "error": {
                                            "description": "Present on upstream rejection",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates": {
            "get": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Get list of campaign templates",
                "description": "Returns paginated campaign templates with optional filtering by category and search",
                "operationId": "getCampaignTemplates",
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Filter templates by category",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "general",
                                "newsletter",
                                "promotional",
                                "transactional",
                                "welcome",
                                "followup"
                            ]
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search templates by title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of items per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Templates retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Welcome Email Template"
                                                    },
                                                    "template_category": {
                                                        "type": "string",
                                                        "example": "welcome"
                                                    },
                                                    "template_description": {
                                                        "type": "string",
                                                        "example": "Template for welcoming new users"
                                                    },
                                                    "from_name": {
                                                        "type": "string",
                                                        "example": "Company Name"
                                                    },
                                                    "from_email": {
                                                        "type": "string",
                                                        "example": "noreply@company.com"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Templates retrieved successfully"
                                        },
                                        "pagination": {
                                            "properties": {
                                                "total": {
                                                    "type": "integer",
                                                    "example": 50
                                                },
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 5
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Create a new campaign template",
                "description": "Creates a new campaign template with validation",
                "operationId": "createCampaignTemplate",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "template_category"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Newsletter Template"
                                    },
                                    "template_category": {
                                        "type": "string",
                                        "enum": [
                                            "general",
                                            "newsletter",
                                            "promotional",
                                            "transactional",
                                            "welcome",
                                            "followup"
                                        ]
                                    },
                                    "template_description": {
                                        "type": "string",
                                        "example": "Monthly newsletter template"
                                    },
                                    "from_name": {
                                        "type": "string",
                                        "example": "Company Name"
                                    },
                                    "from_email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "reply_to": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "preview_text": {
                                        "type": "string"
                                    },
                                    "html_body": {
                                        "type": "string"
                                    },
                                    "json_body": {
                                        "type": "string"
                                    },
                                    "email_type": {
                                        "type": "string",
                                        "enum": [
                                            "marketing",
                                            "follow_up"
                                        ]
                                    },
                                    "signature": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates/{id}": {
            "get": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Get specific campaign template details",
                "description": "Returns detailed information about a specific campaign template",
                "operationId": "getCampaignTemplate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template retrieved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Update an existing campaign template",
                "description": "Updates an existing campaign template with validation",
                "operationId": "updateCampaignTemplate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "template_category"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "template_category": {
                                        "type": "string",
                                        "enum": [
                                            "general",
                                            "newsletter",
                                            "promotional",
                                            "transactional",
                                            "welcome",
                                            "followup"
                                        ]
                                    },
                                    "template_description": {
                                        "type": "string"
                                    },
                                    "from_name": {
                                        "type": "string"
                                    },
                                    "from_email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "reply_to": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "preview_text": {
                                        "type": "string"
                                    },
                                    "html_body": {
                                        "type": "string"
                                    },
                                    "json_body": {
                                        "type": "string"
                                    },
                                    "email_type": {
                                        "type": "string",
                                        "enum": [
                                            "marketing",
                                            "follow_up"
                                        ]
                                    },
                                    "signature": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Template updated successfully"
                    },
                    "404": {
                        "description": "Template not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Delete a campaign template",
                "description": "Soft deletes a campaign template",
                "operationId": "deleteCampaignTemplate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template deleted successfully"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates/from-campaign/{campaignId}": {
            "post": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Create template from existing campaign",
                "description": "Creates a new template using data from an existing campaign",
                "operationId": "createTemplateFromCampaign",
                "parameters": [
                    {
                        "name": "campaignId",
                        "in": "path",
                        "description": "Campaign ID to create template from",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "template_category"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Template from Campaign"
                                    },
                                    "template_category": {
                                        "type": "string",
                                        "enum": [
                                            "general",
                                            "newsletter",
                                            "promotional",
                                            "transactional",
                                            "welcome",
                                            "followup"
                                        ]
                                    },
                                    "template_description": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Template created from campaign successfully"
                    },
                    "404": {
                        "description": "Campaign not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates/categories": {
            "get": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Get available template categories",
                "description": "Returns list of available email template categories from the database",
                "operationId": "getTemplateCategories",
                "parameters": [
                    {
                        "name": "include_count",
                        "in": "query",
                        "description": "Include template count for each category",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    {
                        "name": "active_only",
                        "in": "query",
                        "description": "Only return categories that have active templates",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Categories retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Newsletter"
                                                    },
                                                    "template_count": {
                                                        "description": "Only included if include_count=true",
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Categories retrieved successfully"
                                        },
                                        "total_categories": {
                                            "type": "integer",
                                            "example": 6
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Create a new template category",
                "description": "Creates a new email template category",
                "operationId": "createTemplateCategory",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Category name (must be unique)",
                                        "type": "string",
                                        "example": "Social Media"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 7
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Social Media"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates/categories/{id}": {
            "get": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Get specific template category",
                "description": "Returns detailed information about a specific email template category",
                "operationId": "getTemplateCategory",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include_templates",
                        "in": "query",
                        "description": "Include templates belonging to this category",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Category retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Newsletter"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "templates_count": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "templates": {
                                                    "description": "Only included if include_templates=true",
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category retrieved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Category not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Update a template category",
                "description": "Updates an existing email template category",
                "operationId": "updateTemplateCategory",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Updated Category Name"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Category updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Category not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Delete a template category",
                "description": "Soft deletes an email template category (only if no templates are using it)",
                "operationId": "deleteTemplateCategory",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Category deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Category not found"
                    },
                    "400": {
                        "description": "Cannot delete category with existing templates"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-templates/data-table/get": {
            "post": {
                "tags": [
                    "Campaign Templates"
                ],
                "summary": "Get campaign templates data for DataTables",
                "description": "Returns campaign templates data formatted for DataTables with server-side processing",
                "operationId": "templateDataTable",
                "parameters": [
                    {
                        "name": "search[value]",
                        "in": "query",
                        "description": "Global search value",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order[0][column]",
                        "in": "query",
                        "description": "Column index to sort by",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order[0][dir]",
                        "in": "query",
                        "description": "Sort direction (asc or desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Starting point for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 0
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables response with templates data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 50
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 25
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Welcome Email Template"
                                                    },
                                                    "category_name": {
                                                        "type": "string",
                                                        "example": "Welcome"
                                                    },
                                                    "user_name": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "usage_count": {
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "has_image": {
                                                        "type": "boolean",
                                                        "example": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get all campaigns for authenticated user's client",
                "description": "Returns a list of all campaigns associated with the authenticated user's client.",
                "operationId": "getCampaigns",
                "responses": {
                    "200": {
                        "description": "List of campaigns",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "title": {
                                                "type": "string",
                                                "example": "Spring Sale"
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 10
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "example": "2024-05-19T12:34:56Z"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Create a new campaign",
                "operationId": "8ae0039dad0356eb189bf948106beb3e",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the campaign",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "html_body",
                        "in": "query",
                        "description": "HTML body content of the campaign",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "preview_text",
                        "in": "query",
                        "description": "Preview text of the campaign",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 140
                        }
                    },
                    {
                        "name": "file[]",
                        "in": "query",
                        "description": "Files attached to the campaign",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Added Successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/get-list-without-html-and-json": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get campaigns list excluding HTML and JSON fields",
                "description": "Returns list of campaigns filtered by user permissions",
                "operationId": "bcd3fe2b520b0cbae4f09d074963219c",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter campaigns by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of campaigns",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "user_id": {
                                                "type": "integer"
                                            },
                                            "client_id": {
                                                "type": "integer"
                                            },
                                            "assigned_to": {
                                                "type": "integer",
                                                "nullable": true
                                            },
                                            "template_id": {
                                                "type": "integer",
                                                "nullable": true
                                            },
                                            "title": {
                                                "type": "string"
                                            },
                                            "from_name": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "from_email": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "followup": {
                                                "type": "boolean",
                                                "nullable": true
                                            },
                                            "reply_to": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "preview_text": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "attachment": {
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "signature": {
                                                "type": "boolean",
                                                "nullable": true
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "deleted_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "nullable": true
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/data-table/get": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get campaign data",
                "description": "Get campaign data as per datatable response.",
                "operationId": "dataTable",
                "responses": {
                    "200": {
                        "description": "Campaign data retured",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "campaign": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 102
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Copy of Spring Launch Campaign"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-19T10:15:00Z"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-19T10:15:00Z"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found or unauthorized access",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "campaign": {
                                            "type": "string",
                                            "example": "Campaign Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-data-table": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get campaign data table",
                "description": "Fetches campaign data with aggregated email metrics for datatables display.",
                "operationId": "campaignDataTable",
                "responses": {
                    "200": {
                        "description": "List of campaigns with aggregated email metrics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 101
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "queued_final": {
                                                        "type": "integer",
                                                        "example": 50
                                                    },
                                                    "sent": {
                                                        "type": "integer",
                                                        "example": 45
                                                    },
                                                    "viewed": {
                                                        "type": "integer",
                                                        "example": 30
                                                    },
                                                    "clicked": {
                                                        "type": "integer",
                                                        "example": 10
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 100
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/{id}": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get campaign details by ID",
                "operationId": "8e034f55ccc41b27c1d34103d8d0ab28",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "Spring Promotion"
                                        },
                                        "html_body": {
                                            "type": "string"
                                        },
                                        "is_from_email_verified": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "attachment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No Campaign Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Campaign Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Delete a campaign by ID",
                "operationId": "f97b1dbe79b41c4f3c93143d03ec4ca0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/save-campaign/{id}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Update a campaign",
                "description": "Updates an existing campaign with title, HTML body, preview text, and optional attachments.",
                "operationId": "d9b362897c52d2ef940c096d23b64e3b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "title",
                                    "html_body"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "New Campaign Title",
                                        "maxLength": 191
                                    },
                                    "html_body": {
                                        "type": "string",
                                        "example": "<p>This is the HTML body of the campaign</p>"
                                    },
                                    "preview_text": {
                                        "type": "string",
                                        "example": "This is a preview",
                                        "maxLength": 140
                                    },
                                    "file[]": {
                                        "description": "Multiple attachment files",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Updated Successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Campaign not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/save-followup/{id}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Save followup status for a campaign",
                "description": "Updates the followup field of a campaign by ID",
                "operationId": "7c1c5c36dc97d9c3803119155419264f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "followup"
                                ],
                                "properties": {
                                    "followup": {
                                        "type": "string",
                                        "example": "1"
                                    },
                                    "leadId": {
                                        "type": "integer",
                                        "example": 123,
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Followup saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Followup Saved Successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/update_title/{id}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Update campaign title",
                "description": "Updates the title of a campaign by ID.",
                "operationId": "f2671a0c63518d47f8bef471446d1b75",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Updated Campaign Title"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign Title Saved Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Title Saved Successfully"
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "Updated Campaign Title"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Campaign not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/lead-search": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Search campaign leads based on filters and keywords",
                "description": "Searches leads using start and end date, and keyword for contact/company fields.",
                "operationId": "leadSearch",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for the search range",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for the search range (must be after or equal to start_date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-12-31"
                        }
                    },
                    {
                        "name": "search[value]",
                        "in": "query",
                        "description": "Search keyword for name, email, mobile, or company",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "john"
                        }
                    },
                    {
                        "name": "search[regex]",
                        "in": "query",
                        "description": "Whether the search value should be interpreted as a regular expression",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of matched leads",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "assigned_to": {
                                                        "type": "integer",
                                                        "example": 2
                                                    },
                                                    "contact_id": {
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "company_name": {
                                                        "type": "string",
                                                        "example": "Acme Inc."
                                                    },
                                                    "company_id": {
                                                        "type": "integer",
                                                        "example": 3
                                                    },
                                                    "mobile_number": {
                                                        "type": "string",
                                                        "example": "1234567890"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "example": "john@example.com"
                                                    },
                                                    "lead_position_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-01-01T12:00:00Z"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "No search results found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No search results found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/send": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send campaign emails to selected leads or filtered list",
                "description": "Initiates sending of a campaign to either selected leads or all filtered leads.",
                "operationId": "sendCampaignEmails",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "The ID of the campaign to send",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    },
                    {
                        "name": "list_selection_type",
                        "in": "query",
                        "description": "Indicates whether all leads are selected or filtered",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "all_selected",
                            "enum": [
                                "all_selected",
                                "all_filtered"
                            ]
                        }
                    },
                    {
                        "name": "lead_ids[]",
                        "in": "query",
                        "description": "Array of lead IDs (required if list_selection_type is all_selected)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "contact_ids[]",
                        "in": "query",
                        "description": "Array of contact IDs (required if list_selection_type is all_selected)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "email_list[]",
                        "in": "query",
                        "description": "Array of email addresses (required if list_selection_type is all_selected)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    },
                    {
                        "name": "schedule_time",
                        "in": "query",
                        "description": "Schedule time to send emails (optional, UTC timezone expected)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2025-06-01T10:00:00Z"
                        }
                    },
                    {
                        "name": "campaign_sending_initiated_from",
                        "in": "query",
                        "description": "Origin of the request, used to include extra fields",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "from_lead_edit_tab"
                        }
                    },
                    {
                        "name": "updated_campaign_html",
                        "in": "query",
                        "description": "Updated HTML content of the campaign (sent if initiated from lead edit tab)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_campaign_bcc_emails",
                        "in": "query",
                        "description": "BCC email addresses (sent if initiated from lead edit tab)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Emails initiated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Emails sending has been initiated."
                                        },
                                        "is_email_verified_check": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "start_automation_message": {
                                            "type": "string",
                                            "example": "Automation started."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "An error occurred"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "line_number": {
                                            "type": "integer",
                                            "example": 123
                                        },
                                        "is_email_verified_check": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/upload-file": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Upload a file for Unlayer editor",
                "description": "Uploads a single file and returns file info and URL",
                "operationId": "uploadUnlayerFile",
                "requestBody": {
                    "description": "File to upload",
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "description": "File to upload",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "File has been uploaded Successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "file_name": {
                                                    "type": "string",
                                                    "example": "abc123.jpg"
                                                },
                                                "filelink": {
                                                    "type": "string",
                                                    "example": "https://example.com/storage/unlayer-files/abc123.jpg"
                                                },
                                                "file_size": {
                                                    "type": "integer",
                                                    "example": 123456
                                                },
                                                "extension": {
                                                    "type": "string",
                                                    "example": "jpg"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/delete-all": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Delete multiple campaigns",
                "description": "Deletes campaigns specified by an array of IDs.",
                "operationId": "deleteAllCampaigns",
                "requestBody": {
                    "description": "Array of campaign IDs to delete",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "ids"
                                ],
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "example": [
                                            1,
                                            2,
                                            3
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaigns deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No campaign IDs provided",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign_list_by_email_type/{email_type}": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get Campaign List By Email Type",
                "description": "Returns a list of campaigns filtered by the email type. If the type is 'follow_up', all campaigns for the client are returned.",
                "operationId": "5b13ce3b8163c5e9a6ac5f09ba0e8961",
                "parameters": [
                    {
                        "name": "email_type",
                        "in": "path",
                        "description": "Type of email to filter campaigns (e.g., 'regular', 'follow_up', etc.)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "regular"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with campaign list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "campaign_list_by_email_type": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 101
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "My Campaign"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No campaigns found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "campaign_list_by_email_type": {
                                            "type": "string",
                                            "example": "No Campaign Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/send-reponse-email-on-form-submit": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send campaign email on form submit",
                "description": "Sends a campaign follow-up email to the provided recipient after form submission.",
                "operationId": "sendResponseEmailOnFormSubmit",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    },
                    {
                        "name": "to_email",
                        "in": "query",
                        "description": "Recipient email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign mail has been sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Campaign not approved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign is not approved. Please get it approved"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "is_email_verified_check": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "from_email": {
                                            "type": "string",
                                            "example": "sender@example.com"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/get-list-campaign-email/{id}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get detailed email stats and list for a campaign",
                "description": "Returns aggregated statistics and email delivery info for a specific campaign.",
                "operationId": "getListCampaignEmail",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    },
                    {
                        "name": "filter_by_event",
                        "in": "query",
                        "description": "Event filter type. Default is 'sent'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "sent"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign email statistics and list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "delivered_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 12:00:00"
                                                    },
                                                    "sent_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 11:50:00"
                                                    },
                                                    "viewed_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 12:10:00"
                                                    },
                                                    "queued_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 11:30:00"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 11:20:00"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2024-06-01 12:15:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "title": {
                                            "type": "string",
                                            "example": "June Newsletter"
                                        },
                                        "Queued": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "Sent": {
                                            "type": "integer",
                                            "example": 95
                                        },
                                        "Delivered": {
                                            "type": "integer",
                                            "example": 90
                                        },
                                        "Viewed": {
                                            "type": "integer",
                                            "example": 80
                                        },
                                        "Clicked": {
                                            "type": "integer",
                                            "example": 25
                                        },
                                        "Failed": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/clone/{id}": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Clone a campaign",
                "description": "Clones an existing campaign and prepends 'Copy of' to the campaign title.",
                "operationId": "campaignListClone",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign to clone",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign cloned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "campaign": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 102
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Copy of Spring Launch Campaign"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-19T10:15:00Z"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-19T10:15:00Z"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found or unauthorized access",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "campaign": {
                                            "type": "string",
                                            "example": "Campaign Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/image-upload-post": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Upload an image to S3 storage",
                "description": "Uploads an image file (jpeg, png, jpg, gif, svg) with max size 2MB and returns the accessible URL",
                "operationId": "imageUploadPost",
                "requestBody": {
                    "description": "Image file to upload",
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "image"
                                ],
                                "properties": {
                                    "image": {
                                        "description": "Image file (jpeg, png, jpg, gif, svg)",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "File has been uploaded Successfully"
                                        },
                                        "path": {
                                            "type": "string",
                                            "example": "https://bucket.s3.region.amazonaws.com/images/123456.jpg"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The image field is required."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-email-verify": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Check unverified campaign email addresses",
                "description": "Retrieves a list of campaign 'from_email' and 'reply_to' addresses that are not verified.",
                "operationId": "c9b8f2c851235277a627a47b862a7a0f",
                "responses": {
                    "200": {
                        "description": "List of unverified emails",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "noreply@example.com"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No emails found or all emails verified",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/test-campaign-mail": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send a test campaign email",
                "description": "Sends a test email with campaign content. Appends the user's signature if specified.",
                "operationId": "51442c1644d7e934e8de66543a37781c",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "to_email",
                                    "from_email",
                                    "html_body"
                                ],
                                "properties": {
                                    "to_email": {
                                        "description": "Recipient email",
                                        "type": "string",
                                        "format": "email",
                                        "example": "test@example.com"
                                    },
                                    "from_email": {
                                        "description": "Verified sender email",
                                        "type": "string",
                                        "format": "email",
                                        "example": "sender@example.com"
                                    },
                                    "html_body": {
                                        "description": "HTML content of the email",
                                        "type": "string",
                                        "example": "<p>Hello world!</p>"
                                    },
                                    "signature": {
                                        "description": "Whether to append signature",
                                        "type": "string",
                                        "example": "true",
                                        "enum": [
                                            "true",
                                            "false"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Test email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_verified": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Mail sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Feature temporarily disabled or email not verified",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "is_verified": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email is not verified on AWS."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error sending email",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Some error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/test-campaign-list-mail": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send a test campaign listing",
                "description": "Sends a test email with campaign content.",
                "operationId": "5119778c2ecc9fa976084f3f5bd43df4",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "campaign_id",
                                    "to_mail"
                                ],
                                "properties": {
                                    "to_email": {
                                        "description": "Recipient email",
                                        "type": "string",
                                        "format": "email",
                                        "example": "test@example.com"
                                    },
                                    "campaign_id": {
                                        "description": "Campaign ID",
                                        "type": "id",
                                        "format": "number",
                                        "example": "123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Test email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_verified": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Mail sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Feature temporarily disabled or email not verified",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "is_verified": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email is not verified on AWS."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error sending email",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Some error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/view-reports": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "View campaign reports",
                "description": "Get aggregated campaign email performance metrics filtered by client.",
                "operationId": "viewCampaignReports",
                "responses": {
                    "200": {
                        "description": "List of campaigns with aggregated email metrics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 101
                                                    },
                                                    "campaign_id": {
                                                        "type": "integer",
                                                        "example": 101
                                                    },
                                                    "queued": {
                                                        "type": "integer",
                                                        "example": 150
                                                    },
                                                    "sent": {
                                                        "type": "integer",
                                                        "example": 145
                                                    },
                                                    "viewed": {
                                                        "type": "integer",
                                                        "example": 130
                                                    },
                                                    "clicked": {
                                                        "type": "integer",
                                                        "example": 50
                                                    },
                                                    "total_queued": {
                                                        "type": "integer",
                                                        "example": 150
                                                    },
                                                    "total_sent": {
                                                        "type": "integer",
                                                        "example": 145
                                                    },
                                                    "total_viewed": {
                                                        "type": "integer",
                                                        "example": 130
                                                    },
                                                    "total_clicked": {
                                                        "type": "integer",
                                                        "example": 50
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-19T12:34:56Z"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-19T13:00:00Z"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/view-reports-chart": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get campaign reports chart data",
                "description": "Fetch aggregated campaign email metrics for chart visualization.",
                "operationId": "viewCampaignReportsChart",
                "responses": {
                    "200": {
                        "description": "Aggregated campaign email metrics grouped by campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "chart_report": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "total_queued": {
                                                        "type": "integer",
                                                        "example": 200
                                                    },
                                                    "total_sent": {
                                                        "type": "integer",
                                                        "example": 190
                                                    },
                                                    "total_viewed": {
                                                        "type": "integer",
                                                        "example": 180
                                                    },
                                                    "total_clicked": {
                                                        "type": "integer",
                                                        "example": 120
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Unexpected error occurred."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/send-html-perview": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get personalized HTML preview of a campaign",
                "description": "Returns a preview of the campaign's HTML content after replacing dynamic placeholders with actual values like customer name and appointment date.",
                "operationId": "htmlPreview",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    },
                    {
                        "name": "lead_contact_id",
                        "in": "query",
                        "description": "ID of the lead contact",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 555
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 222
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Preview generated or campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign found."
                                        },
                                        "html": {
                                            "type": "string",
                                            "example": "<html><body>Hello John Doe</body></html>"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/html-perview/{id}": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get HTML preview of a campaign",
                "description": "Returns the HTML content of a campaign, optionally appending the user's signature based on campaign and user settings.",
                "operationId": "getHtmlPreview",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Preview returned or campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign found."
                                        },
                                        "html": {
                                            "type": "string",
                                            "example": "<html><body>Hello, this is the campaign content.<br/>Regards,<br/>Signature</body></html>"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/download-attachment": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Download a specific attachment of a campaign",
                "description": "Downloads the attachment file by campaign ID and attachment index",
                "operationId": "6216a61a1f52803353ee59edd63ab50d",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "The ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123"
                        }
                    },
                    {
                        "name": "attachment_number",
                        "in": "query",
                        "description": "Index of the attachment to download (starts from 0)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File downloaded successfully",
                        "content": {
                            "application/octet-stream": {}
                        }
                    },
                    "400": {
                        "description": "Invalid request"
                    },
                    "404": {
                        "description": "Campaign not found or attachment invalid"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/delete-attachment": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Delete an attachment from a campaign",
                "description": "Deletes an attachment from a campaign by index and updates the attachment list.",
                "operationId": "d405c5047936a7967859ade8a94504af",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "The ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "The index of the attachment to delete (starts from 0)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attachment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Delete campaign attachment successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        },
                                        "deleted_index": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "404": {
                        "description": "Campaign Attachment Not Found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-status-update": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Update Campaign Status",
                "description": "Updates the status of a campaign by ID.",
                "operationId": "updateCampaignStatus",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id",
                                    "status"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Campaign ID",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "status": {
                                        "description": "Status code: 0 = Pending, 1 = Approved, 2 = Rejected",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful update",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Status Updated Successfully."
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Permission denied for update campaign status."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-send/report": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Register a campaign send report",
                "operationId": "6b97cdca7f1d2d18ba78da60d1a9c4f3",
                "responses": {
                    "200": {
                        "description": "Report registered successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "in Report"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/update-subject/{campaign}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Update the subject line of a campaign",
                "operationId": "7705e8550b9198d3ad07b9c1894e5701",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "New subject line for the campaign",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign subject successfully updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign subject successfully updated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-plain-campaign-only-using-title": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Create a plain campaign using only a title",
                "operationId": "37f9e8bfcaf6f0f74b9d3d23b26fb76b",
                "parameters": [
                    {
                        "name": "campaignTitle",
                        "in": "query",
                        "description": "Title of the campaign",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign created successfully."
                                        },
                                        "campaign": {
                                            "type": "object"
                                        },
                                        "clientSettings": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign/{campaign}": {
            "put": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Update an existing campaign",
                "operationId": "ccd7368da6f315d7968ab65dc776eed4",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Campaign title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "html_body",
                        "in": "query",
                        "description": "HTML body of the campaign",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "preview_text",
                        "in": "query",
                        "description": "Preview text for the campaign",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 140
                        }
                    },
                    {
                        "name": "from_email",
                        "in": "query",
                        "description": "Sender email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Updated Successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        },
                                        "setting": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-campaign-to-selected-leads": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send a campaign to selected leads",
                "operationId": "6d3f0ea9a48d62571860b90b88c89994",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Array of lead IDs",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the campaign to send",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sending initiated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-campaign-to-selected-email": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send a campaign to a specific email across selected leads",
                "operationId": "d11aa53ef8e125eb367e031d974c0bc4",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to send the campaign to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the campaign to send",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Array of lead IDs to filter by",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sending initiated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-campaign-schedule-list/{id}": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Get the list of scheduled campaign emails not yet sent",
                "operationId": "7c7a33ba7a571aa3e449572b58b25205",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled contact list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "scheduledContactList": {
                                            "type": "object"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/scheduled-contact/{id}": {
            "delete": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Delete a single scheduled campaign contact",
                "operationId": "9af9f93ffed8895d25ab382f2ea17494",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the scheduled campaign email",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact deleted successfully"
                    },
                    "400": {
                        "description": "Campaign already sent or contact not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-multi-campaign-scheduled-contact": {
            "post": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Delete multiple scheduled campaign contacts",
                "operationId": "864d5db8833569f1716bd0f00459de45",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of scheduled campaign email IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled contacts deleted successfully"
                    },
                    "400": {
                        "description": "Campaign already sent"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-send-for-approval/{id}": {
            "get": {
                "tags": [
                    "Campaign"
                ],
                "summary": "Send a campaign for approval",
                "operationId": "e3a87402b19065aabf4fe600b2c2148f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign successfully sent for approval",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign successfully sent for approval."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/view-campaign-reports": {
            "post": {
                "tags": [
                    "Campaign Reports"
                ],
                "summary": "View Google Ads campaign reports",
                "operationId": "3ff37618f9b661fc4e5ecd5f5c2c7e9a",
                "parameters": [
                    {
                        "name": "gmail_email_address",
                        "in": "query",
                        "description": "Gmail email address for Google Ads account",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for report data (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for report data (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "filter_type",
                        "in": "query",
                        "description": "Type of filter to apply",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "date"
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Google Ads customer ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "manager_id",
                        "in": "query",
                        "description": "Google Ads manager ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign reports retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "email": {
                                                "type": "string"
                                            },
                                            "name": {
                                                "type": "string"
                                            },
                                            "gmail_email": {
                                                "type": "string"
                                            },
                                            "sitedata": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            }
        },
        "/api/view-analytics-reports": {
            "post": {
                "tags": [
                    "Campaign Reports"
                ],
                "summary": "View Google Analytics reports",
                "operationId": "397f6c7b2f9752b64ff34fb4c986f7f2",
                "responses": {
                    "200": {
                        "description": "Analytics reports retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "property_id": {
                                            "properties": {
                                                "name": {
                                                    "type": "string",
                                                    "example": "Website Name"
                                                },
                                                "username": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "telagus_home_page": {
                                                    "type": "string"
                                                },
                                                "logo": {
                                                    "type": "string"
                                                },
                                                "totalUsers": {
                                                    "type": "number"
                                                },
                                                "newUsers": {
                                                    "type": "number"
                                                },
                                                "activeUsers": {
                                                    "type": "number"
                                                },
                                                "sessions": {
                                                    "type": "number"
                                                },
                                                "bounceRate": {
                                                    "type": "number"
                                                },
                                                "avgSessionDuration": {
                                                    "type": "number"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            }
        },
        "/api/campaign-template": {
            "get": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Get list of campaign templates",
                "description": "Returns campaign templates optionally filtered by category ID.",
                "operationId": "listCampaignAsTemplates",
                "parameters": [
                    {
                        "name": "category_id",
                        "in": "query",
                        "description": "Filter templates by category ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful retrieval of campaign templates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "oneOf": [
                                        {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "campaignTemplate": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "category_id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 10
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "example": "Welcome Email"
                                                            },
                                                            "template_image_path": {
                                                                "type": "string",
                                                                "example": "email-templates/welcome.png"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "updated_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Campaign Template Not Found"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error fetching campaign templates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Create a new campaign template",
                "operationId": "e50ba939bad78b3b2478664def0dc6f7",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "html_body",
                                    "json_body",
                                    "template_image_path"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Spring Sale",
                                        "maxLength": 191
                                    },
                                    "html_body": {
                                        "type": "string",
                                        "example": "<h1>Welcome to Spring Sale</h1>"
                                    },
                                    "json_body": {
                                        "type": "string",
                                        "example": "{}"
                                    },
                                    "template_image_path": {
                                        "type": "string",
                                        "example": "images/template1.png",
                                        "maxLength": 191
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign Template Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Added Successfully"
                                        },
                                        "campaign_tempate": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Spring Sale"
                                                },
                                                "html_body": {
                                                    "type": "string"
                                                },
                                                "json_body": {
                                                    "type": "string"
                                                },
                                                "template_image_path": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/campaign-template/{id}": {
            "get": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Get campaign template by ID",
                "operationId": "23925104c4ae5987dfc426f79c51085c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign template to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign template retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "Spring Sale"
                                        },
                                        "html_body": {
                                            "type": "string"
                                        },
                                        "json_body": {
                                            "type": "string"
                                        },
                                        "template_image_path": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign Template Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Campaign Template Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Update a campaign template",
                "operationId": "625b8a5bcbd97bbad34ed8d39d8c6785",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign template to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "html_body",
                                    "json_body",
                                    "template_image_path"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Spring Sale Updated",
                                        "maxLength": 191
                                    },
                                    "html_body": {
                                        "type": "string",
                                        "example": "<html>...</html>"
                                    },
                                    "json_body": {
                                        "type": "string",
                                        "example": "{...}"
                                    },
                                    "template_image_path": {
                                        "type": "string",
                                        "example": "/images/template.png",
                                        "maxLength": 191
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign Template updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Updated Successfully"
                                        },
                                        "campaign": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign Template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Campaign Template Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Delete a campaign template",
                "operationId": "6f88b98876deeb427c6df5aed67dc82f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the campaign template to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign Template deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign Template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/select-template/{id}": {
            "get": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Create a new campaign from an existing campaign template",
                "description": "Clones the selected campaign template into a new draft Campaign for the authenticated user.",
                "operationId": "e4f51bd9000a6ed2a76a7036337acca3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign template ID to clone",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Newly created campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Campaign template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Create a new campaign from a template",
                "description": "Creates a campaign using the specified campaign template ID.",
                "operationId": "selectTemplate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Added Successfully"
                                        },
                                        "campaign": {
                                            "description": "Created Campaign object",
                                            "type": "object",
                                            "example": {
                                                "id": 123,
                                                "user_id": 10,
                                                "client_id": 5,
                                                "html_body": "<html>...</html>",
                                                "json_body": "{...}",
                                                "title": "New Mail",
                                                "campaign_title": "New Mail",
                                                "status": "1",
                                                "created_at": "2025-05-19T12:34:56Z",
                                                "updated_at": "2025-05-19T12:34:56Z"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign Template Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-select-template/{id}": {
            "get": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Get campaign template by ID",
                "description": "Fetches the campaign template details using the template ID.",
                "operationId": "getSelectTemplate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Campaign Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign template fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign fetching Successfully"
                                        },
                                        "campaign": {
                                            "description": "Campaign Template details",
                                            "type": "object",
                                            "example": {
                                                "id": 1,
                                                "category_id": 3,
                                                "name": "Welcome Email",
                                                "html_body": "<html>...</html>",
                                                "json_body": "{...}",
                                                "template_image_path": "path/to/image.jpg",
                                                "created_at": "2025-05-19T12:00:00Z",
                                                "updated_at": "2025-05-19T12:00:00Z"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Campaign Template Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Template Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-campaign-using-template": {
            "post": {
                "tags": [
                    "Campaign Template"
                ],
                "summary": "Create a campaign from a template with a custom title",
                "operationId": "130c114d42a785b4019e073334f17c4c",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "templateId",
                                    "campaignTitle"
                                ],
                                "properties": {
                                    "templateId": {
                                        "description": "Campaign template ID",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "campaignTitle": {
                                        "description": "Title for the new campaign",
                                        "type": "string",
                                        "example": "May Promo"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Newly created campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/latest-conversation-identifier": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get the latest conversation identifier for a user",
                "operationId": "2a89a67cd82b30445e49868c08c77a7e",
                "parameters": [
                    {
                        "name": "project_secret_key",
                        "in": "query",
                        "description": "Project secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "conversation_identifier": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/insert-conversation": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Insert a new conversation",
                "operationId": "6008a41c8f38b0ec53d602ef1198f362",
                "parameters": [
                    {
                        "name": "conversation_identifier",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "project_secret_key",
                        "in": "query",
                        "description": "Project secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "person_id",
                        "in": "query",
                        "description": "Person ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message_content",
                        "in": "query",
                        "description": "Message content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload",
                        "required": false,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "chat_message": {
                                            "type": "object"
                                        },
                                        "notification": {
                                            "type": "object"
                                        },
                                        "sendWebNotificationResponse": {
                                            "type": "string"
                                        },
                                        "ai_response": {
                                            "type": "string"
                                        },
                                        "ai_chat_limit_reached": {
                                            "type": "boolean"
                                        },
                                        "queue_position": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-total-unread-messages-count": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get total unread messages count",
                "operationId": "4e768d90252359852170faebd5ab2d99",
                "parameters": [
                    {
                        "name": "project_secret_key",
                        "in": "query",
                        "description": "Project secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "total_unread": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-total-unread-messages-count-second": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get total unread messages count (alternative method)",
                "operationId": "214acce9f22700d2efd39effbf69ed5f",
                "parameters": [
                    {
                        "name": "project_secret_key",
                        "in": "query",
                        "description": "Project secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "total_unread": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-latest-conversation-messages-list": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get latest conversation messages for sidebar",
                "operationId": "e74877b914b538ea6d1100bf04f5e9e4",
                "parameters": [
                    {
                        "name": "search_term",
                        "in": "query",
                        "description": "Search term",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project_secret_key",
                        "in": "query",
                        "description": "Project secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "latest_messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "assigned": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-conversation-messages-by-conversation-id": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get all conversation messages by conversation ID",
                "operationId": "825b3154834ce28829fc62851003499c",
                "parameters": [
                    {
                        "name": "conversation_identifier",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "all_messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "assigner_id": {
                                            "type": "integer"
                                        },
                                        "queue_position": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-person-details-by-person-random-id": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get person details by person random ID",
                "operationId": "bab1381ac28d0babd3d05f003edc9afc",
                "parameters": [
                    {
                        "name": "person_random_id",
                        "in": "query",
                        "description": "Person random ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "person_details": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-user-personid-by-conversationidentifier": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get person ID by conversation identifier",
                "operationId": "ca84954f9e642067d28efa16edc44512",
                "parameters": [
                    {
                        "name": "conversation_identifier",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "conversation_details": {
                                            "properties": {
                                                "person_id": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/converstaion-mark-as-read": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Mark a conversation as read",
                "operationId": "8edbbed96ccfbe84e157ebf7b6a56851",
                "parameters": [
                    {
                        "name": "conversation_id",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "conversation_status": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/converstaion-mark-as-read-last-messsage_id": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Mark the last message as read",
                "operationId": "26a8a6b4ce5b19c19b606df23f364eb2",
                "parameters": [
                    {
                        "name": "last_message_id",
                        "in": "query",
                        "description": "Last message ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "conversation_status": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-user-email-address": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Update user email address",
                "operationId": "1317ce3fe450210ad16bf8f75943c798",
                "parameters": [
                    {
                        "name": "person_random_id",
                        "in": "query",
                        "description": "Person random ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "update_email_status": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "person_random_id": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/accept-chat": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Accept a chat conversation",
                "operationId": "7d9b24c2665b662bca0bfae3b2da8ff5",
                "parameters": [
                    {
                        "name": "conversation_identifier",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-queue-position-count": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get queue position count",
                "operationId": "6fc4e1bf975f134cec1c90a683b8013f",
                "parameters": [
                    {
                        "name": "conversation_identifier",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "queue_position": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/chat-conversation-report-ai-response": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Report AI response in a chat conversation",
                "operationId": "a2ffee809076bdd87c46bc6c2855ec22",
                "parameters": [
                    {
                        "name": "person_random_id",
                        "in": "query",
                        "description": "Person random ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "conversation_id",
                        "in": "query",
                        "description": "Conversation identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "message_id",
                        "in": "query",
                        "description": "Message ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_reported",
                        "in": "query",
                        "description": "Whether the AI response is reported",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/chat-message": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "List chat messages",
                "operationId": "fa3accd2af8ba6ad05a7ef157d136aeb",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Store a new chat message",
                "operationId": "e1b5e20d66590ba8f10edde42164a65e",
                "parameters": [
                    {
                        "name": "person_id",
                        "in": "query",
                        "description": "Person ID associated with the message",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message_content",
                        "in": "query",
                        "description": "Content of the chat message",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat message stored"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-message/{chat_message}": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Display the specified chat message",
                "operationId": "f7cc689cb38228f7b9bb3083815a1165",
                "parameters": [
                    {
                        "name": "chat_message",
                        "in": "path",
                        "description": "ID of the chat message",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Chat message not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Chat"
                ],
                "summary": "Update the specified chat message",
                "operationId": "b4c31e2f189b877bf29ad0af338f5441",
                "parameters": [
                    {
                        "name": "chat_message",
                        "in": "path",
                        "description": "ID of the chat message to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat message updated"
                    },
                    "404": {
                        "description": "Chat message not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Chat"
                ],
                "summary": "Delete the specified chat message",
                "operationId": "02a9fa19eedcac18701a68a8f0f1f4d6",
                "parameters": [
                    {
                        "name": "chat_message",
                        "in": "path",
                        "description": "ID of the chat message to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat message deleted"
                    },
                    "404": {
                        "description": "Chat message not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-person-details": {
            "get": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Get a list of person details",
                "operationId": "f0c4ffafafc0c67f37c44328d1838d3f",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Store a new person details record (get-person-details resource store)",
                "operationId": "686448e08a10fd4cdf15c062e3390a6d",
                "responses": {
                    "200": {
                        "description": "Person details stored successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-person-details/{id}": {
            "get": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Get specific person details by ID",
                "operationId": "a6852387f1d0c8c2eae56f71ef3edc0f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the person details to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No Attendance Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-person-details/{id}": {
            "put": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Update person details",
                "operationId": "c441778413c1b50789f22fd1d21776c8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the person details to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email of the person",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "Phone number of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Person Details Updated Successfully."
                                        },
                                        "chat_person_details": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Person details not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-person-details-if-exists-if-not-insert/{person_random_id}": {
            "post": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Get person details if exists, otherwise insert new record",
                "operationId": "48377b5408d1f66fdc645833ae14d7d5",
                "parameters": [
                    {
                        "name": "person_random_id",
                        "in": "path",
                        "description": "Random ID of the person",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email of the person",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "Phone number of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details retrieved or created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "was_recently_created": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "person_details": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error retrieving or creating person details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-person-details": {
            "get": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "List person details (update-person-details resource index)",
                "operationId": "d9c8072c6b1b0f3054587393285389d4",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Store a new person details record (update-person-details resource store)",
                "operationId": "6ac6d91c4ea369d81e62a4a9e7b4a8c3",
                "responses": {
                    "200": {
                        "description": "Person details stored successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-person-details/{update_person_detail}": {
            "get": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Display the specified person details record",
                "operationId": "8d7216f81e77da174eaf630337b1f9ff",
                "parameters": [
                    {
                        "name": "update_person_detail",
                        "in": "path",
                        "description": "ID of the person details record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No Attendance Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Delete the specified person details record (update-person-details resource destroy)",
                "operationId": "f0786da5fd7c553043505cfbd0ed7512",
                "parameters": [
                    {
                        "name": "update_person_detail",
                        "in": "path",
                        "description": "ID of the person details record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details deleted successfully"
                    },
                    "404": {
                        "description": "Person details not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-person-details/{get_person_detail}": {
            "put": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Update the specified person details record (get-person-details resource update)",
                "operationId": "767f4e44250cc9638d8d0f6ea075938f",
                "parameters": [
                    {
                        "name": "get_person_detail",
                        "in": "path",
                        "description": "ID of the person details record to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email of the person",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "Phone number of the person",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Person Details Updated Successfully."
                                        },
                                        "chat_person_details": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Person details not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Chat Person Details"
                ],
                "summary": "Delete the specified person details record (get-person-details resource destroy)",
                "operationId": "de0cc0702a4c9e8b18378499f9cc42f8",
                "parameters": [
                    {
                        "name": "get_person_detail",
                        "in": "path",
                        "description": "ID of the person details record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Person details deleted successfully"
                    },
                    "404": {
                        "description": "Person details not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-widget/send-message": {
            "post": {
                "tags": [
                    "Chat Widget"
                ],
                "summary": "Send a visitor message from the embedded chat widget (public)",
                "description": "Unauthenticated (the widget runs on customer websites); rate limited to 30 requests/minute per IP. Upserts the visitor (queueing geo-IP enrichment for new ones), stores the message with any attachments, broadcasts it, and returns the AI auto-response when the widget has AI replies enabled and the visitor is under the per-visitor AI limit.",
                "operationId": "7ae5f6d1ba1c191e5980d26242146b14",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatWidgetSendMessagePayload"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatWidgetSendMessagePayload"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Message stored and broadcast",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "aiResponse": {
                                            "description": "AI auto-reply text; null when AI is disabled, the limit is reached, or a human will answer",
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "messageId": {
                                            "description": "Id of the stored chat message",
                                            "type": "integer"
                                        },
                                        "aiChatLimitReached": {
                                            "description": "True when this visitor has used up the per-visitor AI reply allowance",
                                            "type": "boolean"
                                        },
                                        "queuePosition": {
                                            "description": "Visitor's position in the human-support queue (0 when not queued)",
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (30/minute)"
                    }
                }
            }
        },
        "/api/chat-widget/token": {
            "post": {
                "tags": [
                    "Chat Widget"
                ],
                "summary": "Re-issue a visitor channel token (public)",
                "description": "Unauthenticated; rate limited to 30 requests/minute per IP. Issues a signed token for the visitor's private conversation channel. Only allowed while the conversation does not exist yet, or when the presented person_random_id matches the conversation's person — otherwise 403.",
                "operationId": "db40f304e4e94bf4af56020b11cfcfd9",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "conversation_identifier",
                                    "person_random_id",
                                    "application_id"
                                ],
                                "properties": {
                                    "conversation_identifier": {
                                        "type": "string",
                                        "example": "c_5e9b7a42"
                                    },
                                    "person_random_id": {
                                        "type": "string",
                                        "example": "p_8f3a2c1d"
                                    },
                                    "application_id": {
                                        "description": "Client id of the widget owner; for existing conversations the conversation's own client is used instead",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Signed visitor channel token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "token": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "person_random_id does not match the conversation's person",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Forbidden"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (30/minute)"
                    }
                }
            }
        },
        "/api/chat-widget/broadcasting/auth": {
            "post": {
                "tags": [
                    "Chat Widget"
                ],
                "summary": "Pusher-protocol channel authorization for widget visitors (public)",
                "description": "Unauthenticated; rate limited to 60 requests/minute per IP. A valid visitor token authorizes exactly one channel — the private conversation channel named in the token (private-chat.conversation.{conversation_identifier}). Returns the Reverb HMAC auth string the Pusher client expects.",
                "operationId": "aa0f2c6fb6bbf94706525abc78d34469",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "visitor_token",
                                    "socket_id",
                                    "channel_name"
                                ],
                                "properties": {
                                    "visitor_token": {
                                        "description": "Token issued by /api/chat-widget/token or the widget iframe",
                                        "type": "string"
                                    },
                                    "socket_id": {
                                        "description": "Socket id assigned by the Reverb/Pusher connection",
                                        "type": "string",
                                        "example": "123456.7891011"
                                    },
                                    "channel_name": {
                                        "description": "Must equal private-chat.conversation.{conversation_identifier} for the token's conversation",
                                        "type": "string",
                                        "example": "private-chat.conversation.c_5e9b7a42"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Channel authorization signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "auth": {
                                            "description": "Pusher auth string: \"{app_key}:{hmac_sha256_signature}\"",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Invalid/expired visitor token, or the channel is not the one this token authorizes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid or expired visitor token."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (60/minute)"
                    }
                }
            }
        },
        "/api/chatbot-credits": {
            "get": {
                "tags": [
                    "Chatbot Credits"
                ],
                "summary": "Current AI credit position for the authenticated client",
                "description": "The shared getAiCredit() pool: assigned credits reduced by the book-priced token usage of both the Copilot and the chat widget (1 credit = 0.01 of currency). granted = balance + used.",
                "operationId": "7e30d2c6d592d5c484b81bf7f9ec7ed3",
                "responses": {
                    "200": {
                        "description": "Credit position",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "granted": {
                                            "description": "Total credits ever assigned (balance + used)",
                                            "type": "integer",
                                            "example": 3900
                                        },
                                        "used": {
                                            "type": "integer",
                                            "example": 1200
                                        },
                                        "balance": {
                                            "type": "integer",
                                            "example": 2700
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chatbot-credits/grant": {
            "post": {
                "tags": [
                    "Chatbot Credits"
                ],
                "summary": "Assign AI credits to the authenticated client",
                "description": "Called by external billing systems (e.g. the AI Chat dashboard after a plan purchase). Mirrors the admin AssignCredits flow: records an addon Order + OrderItem + ClientPackageItemLimit triple, which is what getAiCredit() sums as the purchased limit. Pass the price paid so the blended credit unit price stays honest (e.g. 3900 credits for 39.00 = 0.01 per credit).",
                "operationId": "77e95dc69d8e1087b289f76e6392ec4d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "credits"
                                ],
                                "properties": {
                                    "credits": {
                                        "type": "integer",
                                        "example": 3900,
                                        "minimum": 1
                                    },
                                    "price": {
                                        "description": "Amount paid for these credits; defaults to 0",
                                        "type": "number",
                                        "format": "float",
                                        "example": 39,
                                        "nullable": true,
                                        "minimum": 0
                                    },
                                    "source": {
                                        "description": "Label prefixed to the recorded transaction id (defaults to AICHAT)",
                                        "type": "string",
                                        "example": "AICHAT",
                                        "nullable": true,
                                        "maxLength": 100
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Credits assigned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "balance": {
                                            "description": "New balance after the grant",
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chatbot-credits/lapse": {
            "post": {
                "tags": [
                    "Chatbot Credits"
                ],
                "summary": "Lapse the client's remaining AI credit balance",
                "description": "Called by the AI Chat dashboard right before a plan-renewal grant, so every paid cycle starts at exactly the plan allowance instead of stacking. Records a negative Order/OrderItem/ClientPackageItemLimit triple, priced at the credit unit price so the blended price-per-credit stays unchanged. A zero (or negative) balance is a no-op returning lapsed: 0.",
                "operationId": "266e0219b3934a322a2bb85072a1e9d5",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "source": {
                                        "description": "Label prefixed to the recorded transaction id (defaults to AICHAT_LAPSE)",
                                        "type": "string",
                                        "nullable": true,
                                        "maxLength": 100
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Balance lapsed (or nothing to lapse)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lapsed": {
                                            "description": "How many credits were lapsed",
                                            "type": "integer",
                                            "example": 2700
                                        },
                                        "balance": {
                                            "description": "Balance after lapsing (0 after a successful lapse)",
                                            "type": "integer",
                                            "example": 0
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-settings": {
            "get": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Get all chat settings",
                "operationId": "80fea15111ba49bd21ed743fd9bc311f",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "chatting_settings": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Store a new chat setting",
                "operationId": "080d9f59fc6586847f49d36588f7091c",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Chat title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Welcome to our chat"
                        }
                    },
                    {
                        "name": "subtitle",
                        "in": "query",
                        "description": "Chat subtitle",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "How can we help you today?"
                        }
                    },
                    {
                        "name": "background_color",
                        "in": "query",
                        "description": "Chat background color",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "#ffffff"
                        }
                    },
                    {
                        "name": "chat_on_off",
                        "in": "query",
                        "description": "Chat enabled status",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat settings created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Chatsettings Added Successfully"
                                        },
                                        "chatsettings": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-settings/{id}": {
            "get": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Get chat setting by ID",
                "operationId": "c687802882abbdf404f32cee9eca315b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Chat setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Chat setting not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No chatsettings Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Update chat setting",
                "operationId": "1db1bf4acd0e467405fc4da99a922ec2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Chat setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Chat title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Welcome to our chat"
                        }
                    },
                    {
                        "name": "subtitle",
                        "in": "query",
                        "description": "Chat subtitle",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "How can we help you today?"
                        }
                    },
                    {
                        "name": "background_color",
                        "in": "query",
                        "description": "Chat background color",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "#ffffff"
                        }
                    },
                    {
                        "name": "chat_on_off",
                        "in": "query",
                        "description": "Chat enabled status",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Chat Settings Updated Successfully"
                                        },
                                        "chatsettings": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Chat setting not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-if-chat-settings-exists-for-client/{client_id}": {
            "get": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Check if chat settings exist for a client",
                "operationId": "35be31e32e9dc3fe819288d22c1bedf3",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "chatting_settings": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-chat-settings": {
            "post": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Update chat settings",
                "operationId": "4c08f6e248a0f96d9e209a374d3d9b3c",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Chat title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Welcome to our chat"
                        }
                    },
                    {
                        "name": "subtitle",
                        "in": "query",
                        "description": "Chat subtitle",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "How can we help you today?"
                        }
                    },
                    {
                        "name": "background_color",
                        "in": "query",
                        "description": "Chat background color",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "#ffffff"
                        }
                    },
                    {
                        "name": "chat_on_off",
                        "in": "query",
                        "description": "Chat enabled status",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Array of user IDs assigned to chat",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "is_ai_response_enabled",
                        "in": "query",
                        "description": "Whether AI response is enabled",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chat settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-chat-settings-detail": {
            "post": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Get detailed chat settings",
                "operationId": "7482eacc259310963e0710fe660590f9",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "chatting_settings": {
                                            "properties": {
                                                "client_details": {
                                                    "type": "object"
                                                },
                                                "assigned_user_details": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-settings/{chat_setting}": {
            "delete": {
                "tags": [
                    "Chat Settings"
                ],
                "summary": "Delete a chat setting (placeholder – not currently implemented)",
                "operationId": "1cc2d57c486451b66fe579a8dbc30d72",
                "parameters": [
                    {
                        "name": "chat_setting",
                        "in": "path",
                        "description": "Chat settings ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-widgets-datatable": {
            "post": {
                "tags": [
                    "Chat Widgets"
                ],
                "summary": "Server-side datatable listing of the client's chat widgets",
                "description": "Standard DataTables protocol. Search matches name or title; sortable column indexes are 0=name, 1=title, 2=chat_on_off, 3=is_ai_response_enabled, 4=updated_at (default: updated_at desc).",
                "operationId": "643c5e2857b4f69e2075caea7a3d4a18",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "draw": {
                                        "description": "Echoed back for DataTables",
                                        "type": "integer",
                                        "example": 1,
                                        "nullable": true
                                    },
                                    "start": {
                                        "description": "Offset (defaults to 0)",
                                        "type": "integer",
                                        "example": 0,
                                        "nullable": true
                                    },
                                    "length": {
                                        "description": "Page size (defaults to 10)",
                                        "type": "integer",
                                        "example": 10,
                                        "nullable": true
                                    },
                                    "search": {
                                        "properties": {
                                            "value": {
                                                "description": "Matches widget name or title",
                                                "type": "string"
                                            }
                                        },
                                        "type": "object",
                                        "nullable": true
                                    },
                                    "order": {
                                        "description": "DataTables ordering: order[0][column] (index) and order[0][dir] (asc|desc)",
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "column": {
                                                    "type": "integer",
                                                    "example": 4
                                                },
                                                "dir": {
                                                    "type": "string",
                                                    "enum": [
                                                        "asc",
                                                        "desc"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables page of widgets",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ChatWidget"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-widgets": {
            "post": {
                "tags": [
                    "Chat Widgets"
                ],
                "summary": "Create a chat widget",
                "description": "Creates the widget with sensible defaults: title \"Hello!\", generic prompt suggestions, default colors/icon, widget and AI replies enabled, a fresh widget_key, and the creator as the only assigned user.",
                "operationId": "16e0be08db2a8792733a71f20076fd54",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Internal widget name",
                                        "type": "string",
                                        "example": "Main website",
                                        "maxLength": 200
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Widget created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "widget": {
                                            "$ref": "#/components/schemas/ChatWidget"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/chat-widgets/{id}": {
            "get": {
                "tags": [
                    "Chat Widgets"
                ],
                "summary": "Get one of the client's chat widgets",
                "operationId": "ccd1f797bf229d9295f4ece3157fcc97",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Widget ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Widget details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "widget": {
                                            "$ref": "#/components/schemas/ChatWidget"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Chat widget not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Chat widget not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat Widgets"
                ],
                "summary": "Update a chat widget",
                "description": "Omitting greeting_message, prompt_suggestions or launcher_position keeps their stored values (so callers that predate these fields don't null them out); blank prompt-suggestion rows are dropped. In contrast, subtitle, background_color, chat_on_off, assigned_to and is_ai_response_enabled are always overwritten with the sent value — omitting them nulls them, so always send the full current state. chat_icon is no longer client-selectable and is ignored.",
                "operationId": "7ba8c2fd0e3a45edbec23aefda5e016d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Widget ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "title"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 200
                                    },
                                    "title": {
                                        "type": "string"
                                    },
                                    "subtitle": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "greeting_message": {
                                        "type": "string",
                                        "nullable": true,
                                        "maxLength": 500
                                    },
                                    "prompt_suggestions": {
                                        "description": "Max 4 entries, each up to 120 chars; blank entries are dropped",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "maxLength": 120
                                        },
                                        "nullable": true
                                    },
                                    "launcher_position": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "left",
                                            "right"
                                        ]
                                    },
                                    "background_color": {
                                        "type": "string",
                                        "example": "#b743ae",
                                        "nullable": true
                                    },
                                    "chat_on_off": {
                                        "type": "integer",
                                        "nullable": true,
                                        "enum": [
                                            0,
                                            1
                                        ]
                                    },
                                    "assigned_to": {
                                        "description": "User ids to assign (stored JSON-encoded)",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "nullable": true
                                    },
                                    "is_ai_response_enabled": {
                                        "type": "integer",
                                        "nullable": true,
                                        "enum": [
                                            0,
                                            1
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Widget updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "widget": {
                                            "$ref": "#/components/schemas/ChatWidget"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Chat widget not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Chat widget not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Chat Widgets"
                ],
                "summary": "Delete a chat widget",
                "description": "The client's last remaining widget cannot be deleted.",
                "operationId": "92f1718b2160ce611811d170658b6da5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Widget ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Widget deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Chat widget not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Chat widget not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "This is the client's only widget",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You must keep at least one chat widget."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/choose-module": {
            "get": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Display a listing of choose module configurations",
                "operationId": "bea4230d796decf9ae35242d1ef9a27b",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Store a new choose module configuration or update existing one",
                "operationId": "f015f0c3ad090f6896bc762cf77f7427",
                "parameters": [
                    {
                        "name": "response",
                        "in": "query",
                        "description": "Module configuration response data",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Choose Module has been added/updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Choose Module has been added successfully."
                                        },
                                        "data": {
                                            "properties": {
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "response": {
                                                    "type": "string"
                                                },
                                                "created_by": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-choose-module-by-client-id/{clientId}": {
            "get": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Get choose module configuration by client ID",
                "operationId": "7753aa95eecf7704ae1365c9f8d74655",
                "parameters": [
                    {
                        "name": "clientId",
                        "in": "path",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Choose Module is successfully fetched",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Choose Module is sucessfully fetch."
                                        },
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "response": {
                                                    "type": "string"
                                                },
                                                "created_by": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "updated_by": {
                                                    "type": "integer",
                                                    "example": null
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "deleted_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Choose Module is not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/choose-module/{choose_module}": {
            "get": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Display the specified choose module configuration",
                "operationId": "ba1643b1b0a5d3c1285de605a3aad558",
                "parameters": [
                    {
                        "name": "choose_module",
                        "in": "path",
                        "description": "ID of the choose module",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Choose module not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Update the specified choose module configuration",
                "operationId": "6dfaff9f1d3be64feab9731f489b5bdf",
                "parameters": [
                    {
                        "name": "choose_module",
                        "in": "path",
                        "description": "ID of the choose module to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Choose module updated successfully"
                    },
                    "404": {
                        "description": "Choose module not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Choose Module"
                ],
                "summary": "Remove the specified choose module configuration",
                "operationId": "d1bd16a3db0a0616d223a217bcd0d0e6",
                "parameters": [
                    {
                        "name": "choose_module",
                        "in": "path",
                        "description": "ID of the choose module to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Choose module deleted successfully"
                    },
                    "404": {
                        "description": "Choose module not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-list": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "List clients and email creation permission",
                "description": "Fetches all clients and indicates whether the authenticated admin user can create a new email.",
                "operationId": "listClients",
                "responses": {
                    "200": {
                        "description": "Clients retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "clients": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 101
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Acme Inc."
                                                    },
                                                    "logo": {
                                                        "type": "string",
                                                        "example": "https://example.com/storage/client-logo/logo.png"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "showCreateEmail": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No client found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No client found"
                                        },
                                        "showCreateEmail": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "List all clients and email creation permission",
                "operationId": "7fc8461594ad582ff05e6bd57c63a968",
                "responses": {
                    "200": {
                        "description": "Clients retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "clients": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "showCreateEmail": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No client found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Create a new client",
                "operationId": "c9c3369b7c5822719951ebda86c8f88f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Acme Corporation"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "info@acme.com"
                                    },
                                    "phone_number": {
                                        "type": "string",
                                        "example": "+441234567890"
                                    },
                                    "address": {
                                        "type": "string",
                                        "example": "123 Acme Street"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Client created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Client created successfully."
                                        },
                                        "client": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Acme Corporation"
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "example": "info@acme.com"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/{id}": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "Get a specific client",
                "operationId": "4cb53fe37268751bd926e87ff123fcdb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Client found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Client not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Client"
                ],
                "summary": "Update an existing client",
                "operationId": "5778c578bb9bb25b252905be59299edd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the client to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Acme Corporation"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "info@acme.com"
                                    },
                                    "phone_number": {
                                        "type": "string",
                                        "example": "+441234567890"
                                    },
                                    "address": {
                                        "type": "string",
                                        "example": "123 Acme Street"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Client updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Client updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input"
                    },
                    "404": {
                        "description": "Client not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Client"
                ],
                "summary": "Delete a client",
                "operationId": "8ea643341edcad3f8dddd0d54c61f41d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Client deleted successfully"
                    },
                    "404": {
                        "description": "Client not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/logo-upload": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Upload client logo",
                "operationId": "5f13dbd126d02cde5b86e58b40c2e6d2",
                "parameters": [
                    {
                        "name": "logo",
                        "in": "query",
                        "description": "Base64 encoded image string",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "data:image/png;base64,iVBORw0KGgoAAAANS..."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Logo uploaded successfully"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/update-settings": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Update client settings",
                "operationId": "ca63abe66df555314104be697c171969",
                "parameters": [
                    {
                        "name": "no_of_rows",
                        "in": "query",
                        "description": "Number of rows per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 10
                        }
                    },
                    {
                        "name": "accepted_file_format",
                        "in": "query",
                        "description": "Accepted file formats",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "image/jpeg,image/png,image/jpg,.doc,.docx,.csv,application/pdf"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Primary currency code. Must be one of the selected currencies.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "GBP"
                        }
                    },
                    {
                        "name": "currencies",
                        "in": "query",
                        "description": "All currency codes selected by the client. The primary currency is always included.",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            },
                            "example": [
                                "GBP",
                                "USD"
                            ]
                        }
                    },
                    {
                        "name": "currency_position",
                        "in": "query",
                        "description": "Currency position, e.g. left or right",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "left"
                        }
                    },
                    {
                        "name": "currency_display",
                        "in": "query",
                        "description": "Whether amounts show the currency symbol or the ISO 4217 currency code. Currency position still decides which side it appears on.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "symbol",
                            "enum": [
                                "symbol",
                                "code"
                            ]
                        }
                    },
                    {
                        "name": "lead_admin_email",
                        "in": "query",
                        "description": "Send lead admin email",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "date_format",
                        "in": "query",
                        "description": "Date format",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "d-m-Y"
                        }
                    },
                    {
                        "name": "time_format",
                        "in": "query",
                        "description": "Time format",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "12_hours"
                        }
                    },
                    {
                        "name": "redirect_route",
                        "in": "query",
                        "description": "Redirect route after login",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "dashboard"
                        }
                    },
                    {
                        "name": "conversion_ratio",
                        "in": "query",
                        "description": "Conversion ratio setting",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "convert_to_other_lead_position"
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Client phone number",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "+441234567890",
                            "nullable": true
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Client email",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "client@example.com",
                            "nullable": true
                        }
                    },
                    {
                        "name": "notification_email",
                        "in": "query",
                        "description": "Client notification email",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "notify@example.com",
                            "nullable": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Client settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Client settings saved successfully."
                                        },
                                        "user": {
                                            "description": "Authenticated user info with position",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/ticket-assigned-to": {
            "post": {
                "tags": [
                    "Client Settings"
                ],
                "summary": "Update ticket assigned to setting for the client",
                "operationId": "ff028d1abc7b06739804ab8530f4d68c",
                "parameters": [
                    {
                        "name": "ticket_assigned_to",
                        "in": "query",
                        "description": "User or role to whom tickets are assigned",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "support_agent"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "ticketAssignedSetting": {
                                            "description": "Number of affected rows",
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The ticket_assigned_to field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/feedback-assigned-to": {
            "post": {
                "tags": [
                    "Client Settings"
                ],
                "summary": "Update feedback assigned to setting for the client",
                "operationId": "349bf7526334494109cb813c530900c0",
                "parameters": [
                    {
                        "name": "feedback_assigned_to",
                        "in": "query",
                        "description": "Array of user IDs to whom feedback notifications are sent",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            },
                            "example": [
                                1,
                                2,
                                3
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback notification settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "feedbackAssignedSetting": {
                                            "description": "Number of affected rows",
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Feedback notification settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The feedback_assigned_to field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-feedback-assigned-to": {
            "get": {
                "tags": [
                    "Client Settings"
                ],
                "summary": "Get current feedback notification users for client",
                "operationId": "d21cb7b03c4412b27127e2b2b7f2ac11",
                "responses": {
                    "200": {
                        "description": "Feedback notification settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "feedback_assigned_to": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            },
                                            "example": [
                                                1,
                                                2,
                                                3
                                            ]
                                        },
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "example": "john@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-settings": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Get client settings",
                "description": "Retrieve settings for the authenticated user's client.",
                "operationId": "getSettings",
                "responses": {
                    "200": {
                        "description": "Client settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "settings": {
                                            "properties": {
                                                "no_of_rows": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "accepted_file_format": {
                                                    "type": "string",
                                                    "example": "image/jpeg,image/png,image/jpg,.doc,.docx,.csv,application/pdf"
                                                },
                                                "currency": {
                                                    "type": "string",
                                                    "example": "GBP"
                                                },
                                                "currencies": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "example": [
                                                        "GBP",
                                                        "USD"
                                                    ]
                                                },
                                                "currency_position": {
                                                    "type": "string",
                                                    "example": "left"
                                                },
                                                "currency_display": {
                                                    "type": "string",
                                                    "example": "symbol",
                                                    "enum": [
                                                        "symbol",
                                                        "code"
                                                    ]
                                                },
                                                "date_format": {
                                                    "type": "string",
                                                    "example": "d-m-Y"
                                                },
                                                "time_format": {
                                                    "type": "string",
                                                    "example": "g:i a"
                                                },
                                                "redirect_route": {
                                                    "type": "string",
                                                    "example": "dashboard"
                                                },
                                                "conversion_ratio": {
                                                    "type": "string",
                                                    "example": "convert_to_other_lead_position"
                                                },
                                                "phone_number": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/update-notify-admin": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Update notify admin setting for client",
                "operationId": "42e461e5d0b95eb87b64549acf6f3ab6",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    },
                    {
                        "name": "contact_after_call_not_answered",
                        "in": "query",
                        "description": "Enable or disable notify admin after call not answered",
                        "required": true,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings Updated"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Error message here"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-notify-admin": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "Get notify admin setting for client",
                "operationId": "4d0ce3d6b8258837ca256a47072519fc",
                "responses": {
                    "200": {
                        "description": "Notify admin setting retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "notify": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Error message here"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Get notify admin setting for the authenticated client",
                "operationId": "4f2e4b6fe7770657bff42670adcca332",
                "responses": {
                    "200": {
                        "description": "Notify admin setting retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "notify": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-date-time-currency-list": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Get lists for date formats, time formats, file formats, timezones, and currencies",
                "operationId": "5cfd34e3fab5b996348284e0715c1b4e",
                "responses": {
                    "200": {
                        "description": "Lists retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "date_format": {
                                            "description": "Available date formats with example",
                                            "type": "object",
                                            "example": {
                                                "d-m-Y": "d-m-Y(19-05-2025)",
                                                "Y-m-d": "Y-m-d(2025-05-19)",
                                                "F j, Y": "F j, Y(May 19, 2025)",
                                                "F jS, Y": "F jS, Y( May 19th, 2025)",
                                                "l j M Y": "l j M Y(Monday 19 May 2025)"
                                            }
                                        },
                                        "time_format": {
                                            "description": "Available time formats with example",
                                            "type": "object",
                                            "example": {
                                                "H:m": "H:m(19:05)",
                                                "H:i:s": "H:i:s(19:05:30)",
                                                "g:i a": "g:i a(7:05 pm)"
                                            }
                                        },
                                        "file_format": {
                                            "description": "Accepted file formats",
                                            "type": "object",
                                            "example": {
                                                "image/jpeg": "jpeg",
                                                "image/png": "png",
                                                "image/jpg": "jpg",
                                                "application/pdf": "pdf",
                                                ".doc": "doc"
                                            }
                                        },
                                        "timezone": {
                                            "description": "List of all PHP timezones",
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "currency_list": {
                                            "description": "Available currencies with details",
                                            "type": "object",
                                            "example": {
                                                "USD": {
                                                    "name": "United States Dollar",
                                                    "symbol": "$"
                                                },
                                                "GBP": {
                                                    "name": "British Pound Sterling",
                                                    "symbol": "£"
                                                }
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client-data-table": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "Get clients with their primary users for datatable",
                "operationId": "86c0a906ba0fcb09c5dc23897944649d",
                "responses": {
                    "200": {
                        "description": "Clients data returned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Client Name"
                                                    },
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-19T12:34:56Z"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "example": "john.doe@example.com"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "active"
                                                    },
                                                    "stripe_id": {
                                                        "type": "string",
                                                        "example": "cus_123456789"
                                                    },
                                                    "mobile_number": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 100
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Get clients with their primary users for datatable",
                "operationId": "3ccad405f0e6ab8c76b7887b2dfc695c",
                "responses": {
                    "200": {
                        "description": "Clients datatable data returned successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-action-plan-prefer-time": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Add preferred time for action plan",
                "operationId": "7faa1c7b989dd1f42cd0c7dae93b7eca",
                "parameters": [
                    {
                        "name": "prefer_time",
                        "in": "query",
                        "description": "Preferred time for action plan",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "09:00 AM"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client (optional, uses authenticated user's client_id if not provided)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Time updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Time updated successfully."
                                        },
                                        "client_setting": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The prefer_time field is required."
                                        },
                                        "errors": {
                                            "properties": {
                                                "prefer_time": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "example": "The prefer_time field is required."
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/toggle-postpaid": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Toggle postpaid billing for a specific service",
                "operationId": "22516ce9d6122be00f7f55cf190d892f",
                "parameters": [
                    {
                        "name": "service_type",
                        "in": "query",
                        "description": "The service to toggle (sms, call, email)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "sms",
                                "call",
                                "email"
                            ]
                        }
                    },
                    {
                        "name": "is_enabled",
                        "in": "query",
                        "description": "Whether to enable (1/true) or disable (0/false) postpaid billing",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Postpaid settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Postpaid setting updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/postpaid-settings": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "Get postpaid billing settings for the client",
                "operationId": "4a7d24ee7c663e810d8c96ed6f51c5e6",
                "responses": {
                    "200": {
                        "description": "Postpaid settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "allow_postpaid_sms": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "allow_postpaid_call": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "allow_postpaid_email": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/postpaid-usage": {
            "get": {
                "tags": [
                    "Client"
                ],
                "summary": "Get postpaid billing usage and cost summary for the current active Stripe subscription",
                "operationId": "49804d26ff73a8bb0961312502ae6eb6",
                "responses": {
                    "200": {
                        "description": "Postpaid usage retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "usage": {
                                            "properties": {
                                                "period_start": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-01 00:00:00"
                                                },
                                                "period_end": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-31 23:59:59"
                                                },
                                                "total_units": {
                                                    "type": "integer",
                                                    "example": 700
                                                },
                                                "total_amount": {
                                                    "type": "number",
                                                    "example": 20
                                                },
                                                "services": {
                                                    "properties": {
                                                        "sms": {
                                                            "properties": {
                                                                "units": {
                                                                    "type": "integer",
                                                                    "example": 150
                                                                },
                                                                "amount": {
                                                                    "type": "number",
                                                                    "example": 15
                                                                },
                                                                "price_id": {
                                                                    "type": "string",
                                                                    "example": "price_1..."
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Client or active subscription not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/pdf-settings": {
            "post": {
                "tags": [
                    "Client"
                ],
                "summary": "Save PDF settings for the authenticated client",
                "operationId": "cf65a871492fe081738ca63d93721b87",
                "responses": {
                    "200": {
                        "description": "PDF settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "PDF settings updated."
                                        },
                                        "client_setting": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Client not found or error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/subscription-renewal-invoice-emails": {
            "post": {
                "tags": [
                    "Client Settings"
                ],
                "summary": "Save additional recipient emails for subscription renewal invoices",
                "description": "Stores extra email addresses that receive subscription renewal invoices. Accepts an array of emails or a comma-separated string. The authenticated user's own email and duplicate entries are skipped automatically.",
                "operationId": "c8294dfbf753d91279c5e1e46439de2e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "subscription_renewal_invoice_emails": {
                                        "description": "Email addresses to receive renewal invoices (array of emails, or a comma-separated string). Send null or an empty array to clear the list.",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "email"
                                        },
                                        "example": [
                                            "accounts@example.com",
                                            "finance@example.com"
                                        ],
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "subscription_renewal_invoice_emails": {
                                            "description": "Normalised (lowercased, de-duplicated) emails that were saved",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "format": "email"
                                            },
                                            "example": [
                                                "accounts@example.com"
                                            ]
                                        },
                                        "skipped_emails": {
                                            "description": "Emails skipped because they match the account email or were duplicates",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "format": "email"
                                            },
                                            "example": []
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription renewal invoice email settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Please enter a valid email address."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client/get-subscription-renewal-invoice-emails": {
            "get": {
                "tags": [
                    "Client Settings"
                ],
                "summary": "Get additional recipient emails for subscription renewal invoices",
                "operationId": "599205528001b75d3a4ffae70fa80e0b",
                "responses": {
                    "200": {
                        "description": "Settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "subscription_renewal_invoice_emails": {
                                            "description": "Saved recipient emails (empty array when none are configured)",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "format": "email"
                                            },
                                            "example": [
                                                "accounts@example.com"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client-product": {
            "get": {
                "tags": [
                    "ClientProduct"
                ],
                "summary": "Get all client products",
                "operationId": "c01c6f7f96d4c6e46582855975c81fef",
                "responses": {
                    "200": {
                        "description": "List of client products",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "client_product": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "ClientProduct"
                ],
                "summary": "Create a new client product",
                "operationId": "8d3dfe4c5eecdc3c067f92a33c135167",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "price"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Premium Hosting"
                                    },
                                    "price": {
                                        "type": "number",
                                        "format": "float",
                                        "example": 99.99
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Product created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "client_product": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client-product/{id}": {
            "get": {
                "tags": [
                    "ClientProduct"
                ],
                "summary": "Get client product by ID",
                "operationId": "808f19f0e4854adeb05a98be76b15f39",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client product ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Client product details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "client_product": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Product not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "ClientProduct"
                ],
                "summary": "Update a client product",
                "operationId": "c1779fa3d59c87b845ab518064b126d3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client product ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Updated Hosting Plan"
                                    },
                                    "price": {
                                        "type": "number",
                                        "format": "float",
                                        "example": 79.99
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Product updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "client_product": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Product not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "ClientProduct"
                ],
                "summary": "Delete a client product",
                "operationId": "21908db61ea98000ccdaf4bf3a60178c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client product ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Product deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Deleted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Product not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhooks/{webhook}/rotate": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Rotate the secret for an incoming webhook",
                "description": "Generates a new secret for the given ClientWebhook and revokes the old one. Authenticated via the existing X-Webhook-Secret header (webhook.secret middleware), not the bearer token.",
                "operationId": "clientWebhookRotate",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "X-Webhook-Secret",
                        "in": "header",
                        "description": "Current webhook secret",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "New secret issued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "Website lead form"
                                        },
                                        "secret": {
                                            "description": "New 50-char secret. Save securely — the old one is revoked.",
                                            "type": "string"
                                        },
                                        "note": {
                                            "type": "string",
                                            "example": "Old secret revoked. Save this new one securely."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid or missing X-Webhook-Secret header"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                }
            }
        },
        "/api/webhooks/{webhook}/deactivate": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Deactivate an incoming webhook",
                "description": "Sets `active=false` on the ClientWebhook. Authenticated via X-Webhook-Secret header.",
                "operationId": "clientWebhookDeactivate",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "X-Webhook-Secret",
                        "in": "header",
                        "description": "Current webhook secret",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook deactivated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook deactivated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid or missing X-Webhook-Secret header"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                }
            }
        },
        "/api/webhooks/{webhook}/lead": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Ingest a lead via an incoming webhook",
                "description": "Validates the lead payload (see IncomingLeadPayload schema), dispatches a WebhookIncomingLead job, and returns immediately. Authenticated via X-Webhook-Secret header against the ClientWebhook row. Webhook id 2 is exempt from header validation (Assured plans / Jennifer's client) and uses ID lookup instead.",
                "operationId": "clientWebhookIncomingLead",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "X-Webhook-Secret",
                        "in": "header",
                        "description": "Webhook secret. Ignored when webhook id is 2.",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/IncomingLeadPayload"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Lead accepted for processing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead is being added."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid or missing webhook secret",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid or missing webhook secret"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Unexpected processing error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Failed to process lead"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/webhooks": {
            "get": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "List active incoming webhooks for the authenticated user's client",
                "operationId": "clientWebhookIndex",
                "responses": {
                    "200": {
                        "description": "Collection of active ClientWebhook rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Create a new incoming webhook",
                "description": "Creates a ClientWebhook for the authenticated user's client and returns the generated secret. The secret is shown ONLY in this response — store it immediately.",
                "operationId": "clientWebhookStore",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Website lead form",
                                        "maxLength": 255
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Webhook created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "Website lead form"
                                        },
                                        "secret": {
                                            "description": "50-char secret. Save securely — not retrievable later.",
                                            "type": "string"
                                        },
                                        "note": {
                                            "type": "string",
                                            "example": "Save this secret securely. It will not be shown again."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhooks/show": {
            "get": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Get the first active incoming webhook for the authenticated user's client",
                "description": "Returns one ClientWebhook (the first active row for the client). Returns 400-class error code when no active webhook exists.",
                "operationId": "clientWebhookShow",
                "responses": {
                    "200": {
                        "description": "Active webhook",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No active webhook exists for this client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhooks/{webhook}": {
            "put": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Update an incoming webhook's settings",
                "description": "Updates the incoming webhook's duplicate-handling behaviour. `update_on_email_match` (default) updates an existing lead when the primary contact email matches; `always_create` always creates a new lead. Scoped to the authenticated user's client.",
                "operationId": "clientWebhookUpdate",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "duplicate_handling"
                                ],
                                "properties": {
                                    "duplicate_handling": {
                                        "description": "What to do when a lead with the same primary contact email already exists",
                                        "type": "string",
                                        "example": "update_on_email_match",
                                        "enum": [
                                            "update_on_email_match",
                                            "always_create"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated ClientWebhook row",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Webhook not found for this client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Soft-delete an incoming webhook",
                "operationId": "clientWebhookDestroy",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook soft-deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook soft deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhooks/sample-data": {
            "get": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Return a sample payload for the incoming-lead webhook",
                "description": "Returns an example payload with the authenticated client's lead positions and custom-field titles pre-populated. Useful for testing third-party integrations.",
                "operationId": "clientWebhookSampleData",
                "responses": {
                    "200": {
                        "description": "Sample payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IncomingLeadPayload"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhooks/{webhook}/sample-data": {
            "get": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Return a sample payload for the incoming-lead webhook (secret auth)",
                "description": "Same response as /api/webhooks/sample-data but authenticated via the X-Webhook-Secret header (webhook.secret middleware) instead of a bearer token. The sample is scoped to the client that owns the webhook.",
                "operationId": "clientWebhookSampleDataBySecret",
                "parameters": [
                    {
                        "name": "webhook",
                        "in": "path",
                        "description": "ClientWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "X-Webhook-Secret",
                        "in": "header",
                        "description": "Current webhook secret",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sample payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IncomingLeadPayload"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid or missing X-Webhook-Secret header"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                }
            }
        },
        "/api/add-outgoing-webhook": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Create an outgoing webhook",
                "description": "Creates an OutgoingWebhook owned by the authenticated user's client. The response is a Yajra DataTables JSON envelope containing every outgoing webhook for the client (the newly-created row included).",
                "operationId": "outgoingWebhookAdd",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/OutgoingWebhookPayload"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables JSON of all outgoing webhooks for the client",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-outgoing-webhooks": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "List outgoing webhooks (DataTables payload)",
                "description": "Returns a Yajra DataTables JSON envelope for every OutgoingWebhook owned by the authenticated user's client. Body is unused.",
                "operationId": "outgoingWebhookList",
                "responses": {
                    "200": {
                        "description": "DataTables JSON",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-outgoing-webhook/{hookId}": {
            "delete": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Delete an outgoing webhook",
                "operationId": "outgoingWebhookDelete",
                "parameters": [
                    {
                        "name": "hookId",
                        "in": "path",
                        "description": "OutgoingWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Result envelope. Returns 200 even on failure — inspect `success`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Record deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outgoing-webhook/{id}": {
            "get": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Get a single outgoing webhook",
                "operationId": "outgoingWebhookShow",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "OutgoingWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "webhook": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-outgoing-webhook/{id}": {
            "put": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Update an outgoing webhook",
                "description": "Updates the OutgoingWebhook row with the supplied configuration. Same body shape as /api/add-outgoing-webhook.",
                "operationId": "outgoingWebhookUpdate",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "OutgoingWebhook ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/OutgoingWebhookPayload"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook updated successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Webhook not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outgoing-webhook/change-status": {
            "post": {
                "tags": [
                    "Client Webhooks"
                ],
                "summary": "Update the status flag on an outgoing webhook",
                "operationId": "outgoingWebhookChangeStatus",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "webhook_id",
                                    "status"
                                ],
                                "properties": {
                                    "webhook_id": {
                                        "description": "OutgoingWebhook ID",
                                        "type": "integer",
                                        "example": 42
                                    },
                                    "status": {
                                        "description": "New status value persisted as-is on the row",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Status updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook status updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Webhook not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/columns-grid-of-custom-fields-by-userid": {
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get columns grid of custom fields by user ID",
                "operationId": "627b5b976528091947debe65ca040678",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID (defaults to authenticated user if not provided)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Columns grid data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "field_columns_json": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No Custom Field Columns Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-columns-grid-of-custom-fields-by-userid": {
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Update columns grid of custom fields by user ID",
                "operationId": "d9da2a855203993362aff07e7d7cae26",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_columns_json",
                        "in": "query",
                        "description": "JSON string containing field columns configuration",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Columns grid updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "columns_grid": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/columns-grid-of-leads-by-userid": {
            "post": {
                "tags": [
                    "Columns Grid"
                ],
                "summary": "Get columns grid of leads by user ID",
                "operationId": "6f2a567135405bbb4b4b0ab027cd74da",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID (defaults to authenticated user if not provided)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "position_id",
                        "in": "query",
                        "description": "Position ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Columns grid data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "field_columns_json": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "No Custom Field Columns Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-columns-grid-of-leads-by-userid": {
            "post": {
                "tags": [
                    "Columns Grid"
                ],
                "summary": "Update columns grid of leads by user ID",
                "operationId": "7d3ce9e0d78166625ab1c997acc856c1",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_columns_json",
                        "in": "query",
                        "description": "JSON string containing field columns configuration",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Columns grid updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "columns_grid": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contact-type": {
            "get": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Get a list of contact types",
                "operationId": "6571e1394350c0be8be901941249a1b6",
                "responses": {
                    "200": {
                        "description": "List of contact types retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contact_type": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contact Types Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contact Types Not Found"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Create a new contact type",
                "operationId": "73dc12c0b7564f5e6aeb8f208f4d7bc7",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the contact type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Client"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact type created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contact_type": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact type create successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contact-type-delete-multiple": {
            "post": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Delete multiple contact types",
                "operationId": "4bb545f2b56b6649198250c991956c93",
                "parameters": [
                    {
                        "name": "ids",
                        "in": "query",
                        "description": "Array of contact type IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact types deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact Types Deleted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-lead-contact-type": {
            "post": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Update the contact type of a lead contact",
                "operationId": "ee990a95873a8408abc1065691b782f1",
                "parameters": [
                    {
                        "name": "lead_contact_id",
                        "in": "query",
                        "description": "ID of the lead contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "ID of the contact type",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact type updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact Type Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error occurred",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contact-type/{contact_type}": {
            "get": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Display the specified contact type",
                "operationId": "ce26efdb2eaf534849171e55a01f4160",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "path",
                        "description": "ID of the contact type",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact type retrieved successfully"
                    },
                    "404": {
                        "description": "Contact type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Update the specified contact type",
                "operationId": "2e0268da24fce5b6c44e645893eb6e87",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "path",
                        "description": "ID of the contact type to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the contact type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact type updated successfully"
                    },
                    "404": {
                        "description": "Contact type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Contact Types"
                ],
                "summary": "Delete the specified contact type",
                "operationId": "e077e4250c2b5197b6fb3c5b6c86ad0d",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "path",
                        "description": "ID of the contact type to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact type deleted successfully"
                    },
                    "404": {
                        "description": "Contact type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment/data-table/get": {
            "post": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Get contract attachments for datatable",
                "operationId": "e981818b65bdf2a2ac5ab33dff855ef5",
                "responses": {
                    "200": {
                        "description": "Contract attachments retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment": {
            "get": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Get list of contract attachments as datatable",
                "operationId": "0fda6fc19eedc474b3f4a84c63b93189",
                "responses": {
                    "200": {
                        "description": "Contract attachments retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Store a new contract attachment",
                "operationId": "6d0cf82c9396740ea47714a9562bcb4c",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the attachment",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract attachment created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment Added Successfully"
                                        },
                                        "contract_attachment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment/{id}": {
            "delete": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Delete a specific contract attachment",
                "operationId": "2f7f3d9d73839f4a00f6bd561d14a0de",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the contract attachment to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract attachment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment Deleted Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Contract attachment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment/{contract_attachment}": {
            "get": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Display the specified contract attachment",
                "operationId": "74b77aa590757297e093b8b0b5518a52",
                "parameters": [
                    {
                        "name": "contract_attachment",
                        "in": "path",
                        "description": "ID of the contract attachment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract attachment retrieved successfully"
                    },
                    "404": {
                        "description": "Contract attachment not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Contract Attachments"
                ],
                "summary": "Update the specified contract attachment",
                "operationId": "4420b5092d14c3c490dc5410dae27237",
                "parameters": [
                    {
                        "name": "contract_attachment",
                        "in": "path",
                        "description": "ID of the contract attachment to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract attachment updated successfully"
                    },
                    "404": {
                        "description": "Contract attachment not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment-list": {
            "get": {
                "tags": [
                    "Contract Attachment List"
                ],
                "summary": "List contract attachment lists (resource index – placeholder, not currently implemented)",
                "operationId": "7cb1fb514d52500f5657f2f8282aefc5",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contract Attachment List"
                ],
                "summary": "Store a newly created contract attachment list",
                "operationId": "db97a29ad5f566e1bbbeebb11deaeaac",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "contract_attachment_id",
                        "in": "query",
                        "description": "Array of contract attachment IDs",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract Attachment List Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment List Added Successfully"
                                        },
                                        "contract_attachment_list": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment-list/{id}": {
            "get": {
                "tags": [
                    "Contract Attachment List"
                ],
                "summary": "Get contract attachment list for a specific contract",
                "operationId": "e82137499ffef994e702bd978fc59963",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract attachment list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "contract_attachment_list": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "contract_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "contract_attachment_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01 00:00:00"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01 00:00:00"
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Attachment Title"
                                                    },
                                                    "file": {
                                                        "type": "string",
                                                        "example": "path/to/file.pdf"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract attachment list not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "contract_attachment_list": {
                                            "type": "string",
                                            "example": "Contract attachment list not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Contract Attachment List"
                ],
                "summary": "Remove the specified contract attachment list",
                "operationId": "47cd14cc6c0150b8bc94ead2adf1e0cd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract Attachment List ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract Attachment List Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment List Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract Attachment List Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Attachment List Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Something went wrong",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-attachment-list/{contract_attachment_list}": {
            "put": {
                "tags": [
                    "Contract Attachment List"
                ],
                "summary": "Update a contract attachment list (resource update – placeholder, not currently implemented)",
                "operationId": "6e0832c6cfc9ab11a2fe85898f3f92fa",
                "parameters": [
                    {
                        "name": "contract_attachment_list",
                        "in": "path",
                        "description": "Contract Attachment List ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contracts": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Display a listing of contracts",
                "operationId": "36608b08b9eab4de48b1c14fc98e458a",
                "responses": {
                    "200": {
                        "description": "List of contracts"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Create a new contract",
                "operationId": "762a0ef1d0f8313e5081f13782d95e9e",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Associated lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contract_date",
                        "in": "query",
                        "description": "Contract date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valid_until",
                        "in": "query",
                        "description": "Contract valid until date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "contract_reference",
                        "in": "query",
                        "description": "Optional unique contract reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Added Successfully"
                                        },
                                        "contract": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/data-table/get": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get contracts data for datatable",
                "operationId": "eb1fc24ca63ff49c55cf6b6c605a2237",
                "responses": {
                    "200": {
                        "description": "Contracts data for datatable"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/get-lead-contract-data/{id}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get all contracts for a specific lead",
                "operationId": "3863e2747dbfb78bd0c528f97bef5a3d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contracts data retrieved successfully"
                    },
                    "404": {
                        "description": "Lead not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/add-discount": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Add discount to a contract",
                "operationId": "70ec6acdf2e7bbb2619034dc49c06a26",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "discount_type",
                        "in": "query",
                        "description": "Discount type (percentage or fixed)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "percentage",
                                "fixed"
                            ]
                        }
                    },
                    {
                        "name": "discount_value",
                        "in": "query",
                        "description": "Discount value",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Discount added successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/remove-discount": {
            "delete": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Remove discount from a contract",
                "operationId": "26733c18c20c50d6a814a4bc037c19cf",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Discount removed successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-mail/{id}": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Send contract via email",
                "operationId": "e2bbc7f62315de9c97b6dd80eded9bf1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to send the contract to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Email message",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract email sent successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/get-specific-contract": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get contract details without authentication",
                "operationId": "c93b8caad9ccf8cc876bd90355f477e1",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "hash",
                        "in": "query",
                        "description": "Contract hash for verification",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract details retrieved successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/update-contract": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Update contract without authentication",
                "operationId": "f4e94fe499b0d87952184dfe410e0b39",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "uid",
                        "in": "query",
                        "description": "Contract unique identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Contract status",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "accepted",
                                "declined"
                            ]
                        }
                    },
                    {
                        "name": "decline_reason",
                        "in": "query",
                        "description": "Reason for declining the contract",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract updated successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/without-auth-add-signature": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Add signature to contract without authentication",
                "operationId": "6f1eca83323cf79ae311e1cf535cb78a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "uid",
                        "in": "query",
                        "description": "Contract unique identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "signature",
                        "in": "query",
                        "description": "Client signature (base64 encoded)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Signature added successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-pdf/{id}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Generate PDF for a contract",
                "operationId": "655294f6d15a4ad361960b3dbb03300c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract PDF generated successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/marketer-add-signature": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Add marketer signature to contract",
                "operationId": "afbc4c4b1e467d94300bcbf4d8399e56",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "signature",
                        "in": "query",
                        "description": "Marketer signature (base64 encoded)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Marketer signature added successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/setting": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Add or update contract settings",
                "operationId": "670f27fe170c1dfc7cdee79af02f0b17",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "deposit_type",
                        "in": "query",
                        "description": "Advance payment type (percentage or fixed)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "percentage",
                                "fixed"
                            ]
                        }
                    },
                    {
                        "name": "deposit_amount",
                        "in": "query",
                        "description": "Advance payment amount",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "send_invoice_days",
                        "in": "query",
                        "description": "Days after service completion to send invoice",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cancel_agreement_days",
                        "in": "query",
                        "description": "Days before to cancel agreement",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract settings updated successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/view-reports": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "View contract reports",
                "operationId": "806347317017d1eebf831025b3d0a316",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for report filtering (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for report filtering (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract reports retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/preview-contract": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Save and preview contract",
                "operationId": "a5a1fa6c991001cfaecd316468a18832",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contract_html",
                        "in": "query",
                        "description": "Contract HTML content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract saved and preview generated successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/save-as-template": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Save contract as a template",
                "operationId": "e76a1a6dd0baff695f3eac791b3965ca",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "Template name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract saved as template successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/template-datatable": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get contract templates for datatable",
                "operationId": "ac6b8726ae94141e94340959c031ca4c",
                "responses": {
                    "200": {
                        "description": "Contract templates data for datatable"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/remove-contract-template/{id}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Remove a contract template",
                "operationId": "eb650ad46534fa8dd8bb702f4b379163",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract template removed successfully"
                    },
                    "404": {
                        "description": "Contract template not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/duplicate/{id}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Duplicate a contract",
                "operationId": "6c606c1900237c7b56ba8d18511cf4bd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract ID to duplicate",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract duplicated successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/get-templates": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get all contract templates",
                "operationId": "21b00c820e3f10a9dcb0632f6db0710f",
                "responses": {
                    "200": {
                        "description": "Contract templates retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/get-template/{id}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Get a specific contract template",
                "operationId": "747cf9d0cbd12584a5fe05d0883a4dde",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Contract template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract template retrieved successfully"
                    },
                    "404": {
                        "description": "Contract template not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract/update-contract-html/{contractId}": {
            "post": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Update contract HTML content",
                "operationId": "49d80b6d457ba9fb0ee8ee8a122628be",
                "parameters": [
                    {
                        "name": "contractId",
                        "in": "path",
                        "description": "Contract ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contract_html",
                        "in": "query",
                        "description": "Contract HTML content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract HTML updated successfully"
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contracts/{contract}": {
            "get": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Display the specified contract with activity log and short code values",
                "operationId": "0610541da12565981a2847737b8b9f7c",
                "parameters": [
                    {
                        "name": "contract",
                        "in": "path",
                        "description": "ID of the contract",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contract": {
                                            "type": "object"
                                        },
                                        "shortCodeValueArray": {
                                            "type": "object"
                                        },
                                        "contract_activity_log": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Update the specified contract",
                "operationId": "bb3a9f9a6084256ce6b416415c4f3d31",
                "parameters": [
                    {
                        "name": "contract",
                        "in": "path",
                        "description": "ID of the contract to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Associated lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contract_date",
                        "in": "query",
                        "description": "Contract date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valid_until",
                        "in": "query",
                        "description": "Contract valid until date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "contract_reference",
                        "in": "query",
                        "description": "Optional unique contract reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Updated Successfully."
                                        },
                                        "contract": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Contracts"
                ],
                "summary": "Delete the specified contract",
                "operationId": "76a877501cdbf8d779dcab27e5ef986d",
                "parameters": [
                    {
                        "name": "contract",
                        "in": "path",
                        "description": "ID of the contract to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-items": {
            "get": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Display a listing of contract items",
                "operationId": "8f6b6d1d169cb862bafaa73ee6d3e063",
                "responses": {
                    "200": {
                        "description": "List of contract items"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Store a newly created contract item",
                "operationId": "15e166976de16f0c26f05a038b3a12d4",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the contract item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the contract item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the contract item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of the existing item (optional)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "ID of the contract",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional, calculated if not provided)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract item created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Item Added Successfully"
                                        },
                                        "contract_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-items/{id}": {
            "get": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Display the specified contract item",
                "operationId": "6f07012bc04f52c410fa2dc8714b2cd7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the contract item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract item details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "contract_items": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 2671
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Contract Item Title"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Item description"
                                                },
                                                "rate": {
                                                    "type": "string",
                                                    "example": "150.00"
                                                },
                                                "qty": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total": {
                                                    "type": "string",
                                                    "example": "150.00"
                                                },
                                                "estimate_id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "item_id": {
                                                    "type": "integer",
                                                    "example": 456
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "datetime"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "datetime"
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Priority"
                                                            },
                                                            "value": {
                                                                "type": "string",
                                                                "example": "High"
                                                            },
                                                            "field_type": {
                                                                "type": "string",
                                                                "example": "select",
                                                                "enum": [
                                                                    "text",
                                                                    "textarea",
                                                                    "select",
                                                                    "checkbox",
                                                                    "radio",
                                                                    "date",
                                                                    "file"
                                                                ]
                                                            },
                                                            "file_name": {
                                                                "description": "Only present for file type fields",
                                                                "type": "string",
                                                                "example": "document"
                                                            },
                                                            "ext": {
                                                                "description": "Only present for file type fields",
                                                                "type": "string",
                                                                "example": "pdf"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract item not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Item Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Update the specified contract item",
                "operationId": "a097130dd476b8844aa68ae1398ccd4d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the contract item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the contract item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the contract item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the contract item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional, calculated if not provided)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract item updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Item Updated Successfully."
                                        },
                                        "contract_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract item not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Item Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Remove the specified contract item",
                "operationId": "3c3fa61f4918d362c5b88c22ac83681a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the contract item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contract item deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contract Item Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Contract item not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Item Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/contract-items/get-contract-items-data": {
            "post": {
                "tags": [
                    "Contract Items"
                ],
                "summary": "Get all contract items data for a specific contract",
                "operationId": "ae08da708a0658334e35f20a438e3700",
                "parameters": [
                    {
                        "name": "contract_id",
                        "in": "query",
                        "description": "ID of the contract",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of contract items for the specified contract"
                    },
                    "404": {
                        "description": "Contract items not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contract_item": {
                                            "type": "string",
                                            "example": "Contract Item Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/copilot/chat": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Send a message to the Copilot AI agent",
                "description": "Sends a user message to the Copilot AI agent and returns the agent's response. Requires available AI credits (getAiCredit() > 0). If conversation_id is omitted, a new UUID is generated and returned.",
                "operationId": "copilotChat",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "message"
                                ],
                                "properties": {
                                    "message": {
                                        "description": "User's message to the Copilot",
                                        "type": "string",
                                        "example": "Summarise my open leads this week"
                                    },
                                    "conversation_id": {
                                        "description": "Existing conversation UUID. Omit to start a new conversation.",
                                        "type": "string",
                                        "format": "uuid",
                                        "example": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Chat response generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "properties": {
                                                "response": {
                                                    "description": "Generated AI response text",
                                                    "type": "string"
                                                },
                                                "conversation_id": {
                                                    "type": "string",
                                                    "format": "uuid"
                                                },
                                                "copilot_chat_id": {
                                                    "description": "CopilotChat row ID for the assistant message",
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "like": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "dislike": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "type": {
                                                    "description": "Optional response type tag",
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "link": {
                                                    "description": "Optional related link returned by the agent",
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "user_question_copilot_chats_id": {
                                                    "description": "CopilotChat row ID for the user message",
                                                    "type": "integer",
                                                    "example": 0
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No AI credits available or an exception raised by the agent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "is_credit_available": {
                                            "description": "Only present when credits are exhausted",
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "response": {
                                            "type": "string",
                                            "example": "You did not have enough AI credits"
                                        },
                                        "trace": {
                                            "description": "Stack trace, present only when an exception is raised",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid request"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/copilot/stream": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Stream a Copilot AI response",
                "description": "Same as /api/copilot/chat but returns a Server-Sent Events stream (text/event-stream). Each event line is prefixed with `data: ` and contains a JSON payload. The final event indicates completion. Requires available AI credits.",
                "operationId": "copilotChatStream",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "message"
                                ],
                                "properties": {
                                    "message": {
                                        "description": "User's message to the Copilot",
                                        "type": "string",
                                        "example": "Draft a follow-up email"
                                    },
                                    "conversation_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "example": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "SSE stream of chat tokens / events",
                        "content": {
                            "text/event-stream": {
                                "schema": {
                                    "type": "string",
                                    "example": "data: {\"response\":\"...\"}\\n\\n"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/copilot-chat-like": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Toggle the like flag on a Copilot chat message",
                "description": "Toggles `like` on a CopilotChat row. Pass the CURRENT value of `like` — if 1, it is cleared to 0; if 0, it is set to 1 and `dislike` is cleared.",
                "operationId": "copilotChatLike",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "copilot_chat_id"
                                ],
                                "properties": {
                                    "copilot_chat_id": {
                                        "description": "ID of the CopilotChat row to toggle",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "like": {
                                        "description": "Current like state (0 or 1). The handler toggles based on this value.",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Like toggled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Like Added Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "like": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "dislike": {
                                                    "type": "integer",
                                                    "example": 0
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid chat ID or save failure",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid Chat ID"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/copilot-chat-dislike": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Toggle the dislike flag on a Copilot chat message",
                "description": "Toggles `dislike` on a CopilotChat row. Pass the CURRENT value of `dislike` — if 1, it is cleared to 0; if 0, it is set to 1 and `like` is cleared.",
                "operationId": "copilotChatDislike",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "copilot_chat_id"
                                ],
                                "properties": {
                                    "copilot_chat_id": {
                                        "description": "ID of the CopilotChat row to toggle",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "dislike": {
                                        "description": "Current dislike state (0 or 1). The handler toggles based on this value.",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Dislike toggled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Like Added Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "dislike": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "like": {
                                                    "type": "integer",
                                                    "example": 0
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid chat ID or save failure",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid Chat ID"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-conversion-list": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "List the authenticated user's Copilot conversations",
                "description": "Returns one row per conversation_id with a short preview of the user's first message. If `searchVal` is provided, only conversations whose meta_data.content matches the term (case-insensitive LIKE) are returned.",
                "operationId": "copilotGetConversionList",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "searchVal": {
                                        "description": "Optional search term, matched against the conversation's first user message",
                                        "type": "string",
                                        "example": "leads",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Conversation list retrieved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "conversations": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 123
                                                    },
                                                    "conversation_id": {
                                                        "type": "string",
                                                        "format": "uuid"
                                                    },
                                                    "meta_data": {
                                                        "description": "Truncated preview of the first user message (max ~100 chars, '....' appended when truncated)",
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthorized"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-conversion-chats/{id}": {
            "get": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Get all messages in a Copilot conversation",
                "description": "Returns the ordered list of user and assistant messages belonging to the given conversation_id, owned by the authenticated user. Messages whose meta_data contains a `type` key are skipped.",
                "operationId": "copilotGetConversionChat",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Conversation UUID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversation messages retrieved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "conversation_chats": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "response": {
                                                        "description": "Message content with any [TYPE:...] tag stripped",
                                                        "type": "string"
                                                    },
                                                    "copilot_chat_id": {
                                                        "type": "integer"
                                                    },
                                                    "dislike": {
                                                        "type": "integer"
                                                    },
                                                    "like": {
                                                        "type": "integer"
                                                    },
                                                    "favorite": {
                                                        "type": "integer"
                                                    },
                                                    "isUser": {
                                                        "description": "True if the message was authored by the user",
                                                        "type": "boolean"
                                                    },
                                                    "link": {
                                                        "type": "string",
                                                        "example": ""
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "example": ""
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No chats found or unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No Chats Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/copilot-prompt-fav": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Toggle the favorite flag on a Copilot chat message",
                "description": "Toggles `favorite` on a CopilotChat row. Pass the CURRENT value of `favorite`. When the new state is favorited (1), the response also includes a `favData` block with a display preview of the prompt.",
                "operationId": "copilotPromptFav",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "copilot_chat_id"
                                ],
                                "properties": {
                                    "copilot_chat_id": {
                                        "description": "ID of the CopilotChat row",
                                        "type": "integer",
                                        "example": 123
                                    },
                                    "favorite": {
                                        "description": "Current favorite state (0 or 1). The handler toggles based on this value.",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Favorite toggled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Prompt Favorite Successfully"
                                        },
                                        "response": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "favorite": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "favData": {
                                                    "description": "Only present when the new state is favorited (1)",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "conversation_id": {
                                                            "type": "string",
                                                            "format": "uuid"
                                                        },
                                                        "meta_data": {
                                                            "description": "Full original prompt content",
                                                            "type": "string"
                                                        },
                                                        "display_prompt": {
                                                            "description": "Truncated preview (max ~100 chars)",
                                                            "type": "string"
                                                        }
                                                    },
                                                    "type": "object",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid chat ID or save failure",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid Chat ID"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-fav-prompt-list": {
            "get": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Get the authenticated user's favorite prompts and the full prompt catalog",
                "description": "Returns two collections: (1) `favPrompt` — the user's favorited Copilot chat messages PLUS their favorited entries from the global copilot_prompt catalog; (2) `prompts` — the full copilot_prompt catalog grouped by category, each item annotated with the user's favorite state.",
                "operationId": "copilotGetFavPromptList",
                "responses": {
                    "200": {
                        "description": "Favorite prompts and grouped prompt catalog",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "favPrompt": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "conversation_id": {
                                                        "description": "Only present for entries sourced from CopilotChat",
                                                        "type": "string",
                                                        "format": "uuid",
                                                        "nullable": true
                                                    },
                                                    "display_prompt": {
                                                        "type": "string"
                                                    },
                                                    "meta_data": {
                                                        "type": "string"
                                                    },
                                                    "category": {
                                                        "description": "Only present for entries sourced from the global prompt catalog",
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "prompts": {
                                            "description": "Catalog grouped by category",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "icon": {
                                                        "type": "string"
                                                    },
                                                    "category": {
                                                        "type": "string"
                                                    },
                                                    "items": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "favorite": {
                                                                    "type": "integer",
                                                                    "example": 0
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "moreCount": {
                                                        "type": "integer",
                                                        "example": 3
                                                    },
                                                    "expanded": {
                                                        "type": "boolean",
                                                        "example": false
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Unauthorized"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/prompt-fav": {
            "post": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Toggle a favorite on a global Copilot prompt",
                "description": "Toggles the user's favorite on a row from the copilot_prompt catalog. Pass the CURRENT favorite state — if 1, the favorite row is deleted; if 0, a new CopilotPromptFavorite row is created.",
                "operationId": "copilotPromptCatalogFav",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "prompt_id"
                                ],
                                "properties": {
                                    "prompt_id": {
                                        "description": "ID of the copilot_prompt row",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "favorite": {
                                        "description": "Current favorite state (0 or 1). The handler toggles based on this value.",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Favorite toggled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Prompt Favorite Successfully"
                                        },
                                        "response": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 12
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "item": {
                                                    "type": "string"
                                                },
                                                "favorite": {
                                                    "type": "integer",
                                                    "example": 1
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid prompt ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid Prompt ID"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-conversion/{id}": {
            "get": {
                "tags": [
                    "Copilot"
                ],
                "summary": "Delete a Copilot conversation",
                "description": "Deletes every CopilotChat row matching the given conversation_id. Note: route is GET by current convention; no ownership check is performed in the handler.",
                "operationId": "copilotDeleteConversion",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Conversation UUID to delete",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid",
                            "example": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversation deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Conversation deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Conversation not found or invalid ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/sms-campaign-insert-loop-to-sms-campaign": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Insert eligible leads from SMS campaign loops into the SMS campaign queue",
                "operationId": "c53ff5244d327656013016255ca2449b",
                "responses": {
                    "200": {
                        "description": "Entries inserted into the SMS campaign table"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/initiate-sms-sending": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Initiate sending for queued SMS campaign rows",
                "operationId": "01d4b891203b5cf1927e1ba1a0b79012",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/send-sms": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Send a single queued SMS campaign message",
                "operationId": "a55cfcb61925d22d3bfb3967f60124d1",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "ID of the SMS template to send",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient mobile number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead receiving the SMS",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "row_id",
                        "in": "query",
                        "description": "ID of the SMS campaign row being processed",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS dispatched for sending"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/send-campaign-mail-new": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Process and send pending campaign emails using the new batched flow",
                "operationId": "be72758229c058fe6fea06a0e23cad8b",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/send-whatsapp-message": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Send a queued WhatsApp campaign message",
                "operationId": "a4d411f09249f46db059eaca2d524ae5",
                "parameters": [
                    {
                        "name": "template_id",
                        "in": "query",
                        "description": "WhatsApp template identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient mobile number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead receiving the WhatsApp message",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "row_id",
                        "in": "query",
                        "description": "ID of the WhatsApp campaign row being processed",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "WhatsApp message dispatched for sending"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/send-campaign-mail": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Process and queue pending campaign emails for delivery",
                "operationId": "b9cc5506445da90641e672fca92f5a8d",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/check-valid-mail": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Validate pending lead contact email addresses via the verification provider",
                "operationId": "4e9b41cb1d0c85fa09f371d59ff21336",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/email-send-notification-aws": {
            "post": {
                "tags": [
                    "Cron"
                ],
                "summary": "Receive AWS SNS email delivery/bounce notifications",
                "description": "Endpoint hit by AWS SNS for email delivery, bounce and complaint notifications. The handler inspects the x-amz-sns-message-type header and stores the notification payload.",
                "operationId": "b21460cf0fe3447f60566b616b0c4f7c",
                "requestBody": {
                    "description": "Raw AWS SNS notification payload (JSON)",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "SNS notification processed"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/process-followups": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Process automation followup executions",
                "operationId": "b6002a742979cd58d65a66e4b58eecda",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/sns": {
            "post": {
                "tags": [
                    "Cron"
                ],
                "summary": "Handle AWS SNS subscription confirmation and notification callbacks",
                "description": "Reads the raw php://input AWS SNS payload. For SubscriptionConfirmation messages it fetches the SubscribeURL to confirm the subscription.",
                "operationId": "56fd6cd382973ffdcdb01b2184180511",
                "requestBody": {
                    "description": "Raw AWS SNS notification payload (JSON)",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "SNS callback handled"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/add-auto-increment-numbers-to-invoice": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Backfill per-client auto increment numbers on estimates and invoices",
                "operationId": "780c7c1c08e9cf8d87a9149ab53b13c7",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/process-lead-action": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Process scheduled lead action plan steps (SMS, email, tasks)",
                "operationId": "310fa881f1541187be761463fd1b211c",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/check-bounce-rate-mail": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Check per-client email bounce and complaint rates and block over-limit clients",
                "operationId": "e38128e114671aa9102e97e4ed782cf1",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cron/get-orders-from-magento": {
            "get": {
                "tags": [
                    "Cron"
                ],
                "summary": "Import ecommerce orders (Magento, WordPress, Shopify) as leads",
                "operationId": "8a5ce97ede2ca1a9870c0860f7cfcaa9",
                "responses": {
                    "200": {
                        "description": "Cron job executed successfully"
                    },
                    "500": {
                        "description": "Cron job failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-field-values": {
            "get": {
                "tags": [
                    "Custom Field Values"
                ],
                "summary": "Get list of all custom field values",
                "operationId": "44d1a78d4d5763077d9771e60f45327c",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Custom Field Values"
                ],
                "summary": "Create a new custom field value",
                "operationId": "2cd7fc6ed078247276b785901f42e1de",
                "parameters": [
                    {
                        "name": "value",
                        "in": "query",
                        "description": "Value of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field value added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Values Added Successfully"
                                        },
                                        "custom_field_values": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-field-values/{custom_field_value}": {
            "get": {
                "tags": [
                    "Custom Field Values"
                ],
                "summary": "Display the specified custom field value",
                "operationId": "536e4e8375394eb153be70abc25b05ec",
                "parameters": [
                    {
                        "name": "custom_field_value",
                        "in": "path",
                        "description": "ID of the custom field value",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "No Custom Field Values Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Custom Field Values"
                ],
                "summary": "Update the specified custom field value",
                "operationId": "5d7ac834f19bbfbc6f35b8e246211081",
                "parameters": [
                    {
                        "name": "custom_field_value",
                        "in": "path",
                        "description": "ID of the custom field value to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "value",
                        "in": "query",
                        "description": "Updated value of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field value updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Values Updated Successfully"
                                        },
                                        "custom_field_values": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Custom Field Values"
                ],
                "summary": "Delete the specified custom field value",
                "operationId": "cdc35ed4dd086c72bc38ce40e3f65574",
                "parameters": [
                    {
                        "name": "custom_field_value",
                        "in": "path",
                        "description": "ID of the custom field value to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field value deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Values Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Custom Field Values Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get all custom fields",
                "operationId": "aa7c3704bcfa1c84eb1af67d1f42a2e2",
                "parameters": [
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Filter custom fields by related entity",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Create a new custom field",
                "operationId": "c73f4d49f16ac50c9d88f956d608666d",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Company Size"
                        }
                    },
                    {
                        "name": "field_type",
                        "in": "query",
                        "description": "Type of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "select",
                            "enum": [
                                "text",
                                "textarea",
                                "select",
                                "radio",
                                "checkbox",
                                "date"
                            ]
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Entity this custom field is related to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    },
                    {
                        "name": "options",
                        "in": "query",
                        "description": "Options for select, radio, or checkbox fields",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "required",
                        "in": "query",
                        "description": "Whether this field is required",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": false
                        }
                    },
                    {
                        "name": "placeholder",
                        "in": "query",
                        "description": "Placeholder text for the field",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Enter company size"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Added Successfully"
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/data-table/get": {
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields for data table",
                "operationId": "973537543121828b15a9d4d0b03f92d4",
                "parameters": [
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Filter custom fields by related entity",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields data table data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/{id}": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get a specific custom field",
                "operationId": "fe114d72b4a9fc26a4c8311fa0449c8b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the custom field",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Custom field not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Update a specific custom field",
                "operationId": "0c3f75a23335ed3f565bfc6cd0d2d592",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the custom field to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Company Size"
                        }
                    },
                    {
                        "name": "field_type",
                        "in": "query",
                        "description": "Type of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "select",
                            "enum": [
                                "text",
                                "textarea",
                                "select",
                                "radio",
                                "checkbox",
                                "date"
                            ]
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Entity this custom field is related to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    },
                    {
                        "name": "options",
                        "in": "query",
                        "description": "Options for select, radio, or checkbox fields",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "required",
                        "in": "query",
                        "description": "Whether this field is required",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": false
                        }
                    },
                    {
                        "name": "placeholder",
                        "in": "query",
                        "description": "Placeholder text for the field",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Enter company size"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Updated Successfully"
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Custom field not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Delete a specific custom field",
                "operationId": "f122337c2c8f536d0e5edd6f83460d0b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the custom field to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Deleted Successfully"
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Custom field not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Custom Field Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/client-id/{id}": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields for a specific client",
                "operationId": "57cfa199b3f5734083e9ec20f2a656bf",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "custom_fields_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No custom fields found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Custom Field Data Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/lead-id/{id}": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields for a specific lead",
                "operationId": "71f94294ff1677ccfcec7945bf0f6fde",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Filter custom fields by related entity",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        },
                                        "lead_data": {
                                            "type": "object"
                                        },
                                        "lead_id": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/project-id/{id}": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields for a specific project",
                "operationId": "414b19c9e6c1eae3eff81eb8871c8a7e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Filter custom fields by related entity",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "projects"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        },
                                        "project_data": {
                                            "type": "object"
                                        },
                                        "project_id": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/bulk-delete": {
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Delete multiple custom fields",
                "operationId": "3ef25b90048dd3c19f53039d8371916e",
                "parameters": [
                    {
                        "name": "ids",
                        "in": "query",
                        "description": "Array of custom field IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom fields Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Custom fields not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom fields Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields-update-or-create": {
            "post": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Create or update a custom field",
                "operationId": "c91bcf0ee93620856a37ad9efa4b7802",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the custom field to update (if creating new, omit this parameter)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Company Size"
                        }
                    },
                    {
                        "name": "field_type",
                        "in": "query",
                        "description": "Type of the custom field",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "select",
                            "enum": [
                                "text",
                                "textarea",
                                "select",
                                "radio",
                                "checkbox",
                                "date"
                            ]
                        }
                    },
                    {
                        "name": "related_to",
                        "in": "query",
                        "description": "Entity this custom field is related to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "leads"
                        }
                    },
                    {
                        "name": "options",
                        "in": "query",
                        "description": "Options for select, radio, or checkbox fields",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "required",
                        "in": "query",
                        "description": "Whether this field is required",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": false
                        }
                    },
                    {
                        "name": "placeholder",
                        "in": "query",
                        "description": "Placeholder text for the field",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Enter company size"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field created or updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom fields Added Successfully"
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error while updating custom field"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/custom-fields/get-usage-lead-list": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get usage of custom fields in leads",
                "operationId": "200c3d8a5d351ac30601a131ada4361e",
                "responses": {
                    "200": {
                        "description": "Custom fields usage retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No custom fields usage found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom fields Usage Lead List Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/zapier-custom-fields-propagation": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields list for Zapier integration by user email",
                "description": "Public Zapier-facing endpoint that returns a flat list of custom fields for the client associated with the provided user email.",
                "operationId": "29e7046f4019278706b6b64ba4e64a37",
                "parameters": [
                    {
                        "name": "userName",
                        "in": "query",
                        "description": "Email address of the user whose client's custom fields should be returned",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "custom_fields": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "User not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "User not found!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/custom-fields/item-id/{id}": {
            "get": {
                "tags": [
                    "Custom Fields"
                ],
                "summary": "Get custom fields list for a specific item with current values",
                "operationId": "d19f520c87ee937b05bd43131ff9b8da",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Item ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom fields with values for the item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/dashboard": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get list of dashboards for authenticated user",
                "description": "Fetches all dashboards belonging to the currently authenticated user.",
                "operationId": "getDashboardList",
                "responses": {
                    "200": {
                        "description": "List of dashboards retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "dashboard": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Sales Overview"
                                                    },
                                                    "is_default": {
                                                        "type": "integer",
                                                        "example": 1
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error fetching dashboard list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "dashboard": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Create or update a dashboard",
                "operationId": "e7cf0fe2f3d18ae97f79e88c128b97a1",
                "parameters": [
                    {
                        "name": "dashboardId",
                        "in": "query",
                        "description": "If provided, the dashboard with this ID will be updated.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the dashboard",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Sales Dashboard"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the dashboard",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Dashboard showing sales metrics"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dashboard created or updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard has been added successfully."
                                        },
                                        "data": {
                                            "description": "Dashboard object",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/dashboard/{id}": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get dashboard details by ID",
                "operationId": "890ce73721ef28f5bd534da2b7343e27",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the dashboard to fetch",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dashboard fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard is successfully fetched."
                                        },
                                        "data": {
                                            "description": "Dashboard details object",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Dashboard not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard Not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Update dashboard name by ID",
                "operationId": "51aa89e225769564674a040812f6d9c3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the dashboard to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "New Dashboard Name",
                                        "maxLength": 191
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Dashboard updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard Updated Successfully"
                                        },
                                        "data": {
                                            "description": "Updated dashboard object",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Dashboard not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard Not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Delete a dashboard by ID",
                "operationId": "e72fcb31ff4fd64cfe47d6f3a3dbc593",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the dashboard to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dashboard deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Dashboard not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard Not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/set-default-dashboard": {
            "put": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Set a dashboard as default for the authenticated user",
                "operationId": "3694558009d00b15573985a02ede069b",
                "parameters": [
                    {
                        "name": "dashboardId",
                        "in": "query",
                        "description": "ID of the dashboard to set as default",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 3
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dashboard default updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "updated": {
                                            "description": "Number of dashboards updated",
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input"
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/save-field-grid-of-dashboard": {
            "post": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Save dashboard grid",
                "operationId": "bee7943ddc9687db25fb12ec31066750",
                "parameters": [
                    {
                        "name": "dashboardId",
                        "in": "query",
                        "description": "ID of the dashboard to save the grid for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "fields[]",
                        "in": "query",
                        "description": "Array of field configuration",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "field": {
                                        "type": "string",
                                        "example": "name"
                                    },
                                    "x": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "y": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "w": {
                                        "type": "integer",
                                        "example": 6
                                    },
                                    "h": {
                                        "type": "integer",
                                        "example": 3
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Grid saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "stored_data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-dashboard-exist-or-not": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Check if a default dashboard exists for the authenticated user",
                "description": "This endpoint checks whether a default dashboard exists for the currently authenticated user. If not, it creates one with default widgets.",
                "operationId": "checkDashboardExistOrNot",
                "responses": {
                    "200": {
                        "description": "Dashboard found or created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "dashboard": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Default Dashboard"
                                                },
                                                "is_default": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "widget_list_json": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "example": "loginTimeCard"
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-16T12:34:56.000000Z"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2025-05-16T12:34:56.000000Z"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-field-grid-of-dashboard/{dashboardId}": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Get dashboard grid and widgets",
                "operationId": "9e64af7f320c98087f3040cd4dff2272",
                "parameters": [
                    {
                        "name": "dashboardId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "field_grid_of_dashboard": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DashboardGridItem"
                                            }
                                        },
                                        "widget_list_of_dashboard": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "loginTimeCard"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-ecommerce-sites": {
            "get": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Fetch ecommerce sites by platform",
                "description": "Returns a list of ecommerce marketplace sites based on the selected platform for the authenticated client.",
                "operationId": "getEcommerceSites",
                "parameters": [
                    {
                        "name": "eco",
                        "in": "query",
                        "description": "Platform name (e.g., 'shopify', 'woocommerce')",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "shopify"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of ecommerce sites",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "sites": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "My Shopify Store"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/set-default-dashboard/{dashboardId}": {
            "get": {
                "tags": [
                    "Dashboard"
                ],
                "summary": "Set a dashboard as the user's default",
                "description": "Marks the given Dashboard as default for the authenticated user/client. All other dashboards for the same user/client are cleared (`is_default=0`).",
                "operationId": "setDefaultDashboard",
                "parameters": [
                    {
                        "name": "dashboardId",
                        "in": "path",
                        "description": "Dashboard ID to mark default",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Number of dashboard rows updated (Eloquent update() return)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "integer"
                                },
                                "example": 3
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/device-token": {
            "get": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "List device tokens",
                "operationId": "f7795ffc2baea1585122e6a355d7d872",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "Store a new device token for push notifications",
                "operationId": "660f530735b951ca295ce2bff34fab8c",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "The device token to be stored",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                        }
                    },
                    {
                        "name": "platform",
                        "in": "query",
                        "description": "Device platform. Required for iOS so FCM includes the notification block needed to show a banner when the app is killed.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "ios",
                            "enum": [
                                "ios",
                                "android",
                                "web"
                            ]
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Token transport type. Defaults to 'fcm' when platform is supplied.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "fcm",
                            "enum": [
                                "fcm",
                                "voip",
                                "web"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/device-token/{device_token}": {
            "get": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "Display the specified device token",
                "operationId": "9d32d7da7269a12c13edf9cfda7769ca",
                "parameters": [
                    {
                        "name": "device_token",
                        "in": "path",
                        "description": "ID of the device token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Device token not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "Update the specified device token",
                "operationId": "1011499609e0cd4728a688bb1baf2f57",
                "parameters": [
                    {
                        "name": "device_token",
                        "in": "path",
                        "description": "ID of the device token to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device token updated"
                    },
                    "404": {
                        "description": "Device token not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "Delete the specified device token",
                "operationId": "6f983e16f94285a8606a254b6b34e52e",
                "parameters": [
                    {
                        "name": "device_token",
                        "in": "path",
                        "description": "ID of the device token to delete",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device token deleted"
                    },
                    "404": {
                        "description": "Device token not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/device-token/remove": {
            "post": {
                "tags": [
                    "Device Tokens"
                ],
                "summary": "Remove a specific device token for the authenticated user (on logout)",
                "operationId": "fb5a1158e7942ae66d6033bed7582d6a",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "The device token to remove",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token removed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests/data-table": {
            "post": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Get early requests data for datatable",
                "operationId": "311bd29d12ca4d0b97d6d6e8e20a3f6e",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by start date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by end date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "applied",
                                "approved",
                                "rejected",
                                "assigned",
                                "cancelled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early requests data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests": {
            "get": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "List early requests with filtering and pagination",
                "operationId": "76833f99c50c4948cb4fc48c79cc08db",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "applied",
                                "approved",
                                "rejected",
                                "assigned",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "request_type",
                        "in": "query",
                        "description": "Filter by request type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "early_leaving",
                                "early_coming"
                            ]
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by start date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by end date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Filter by client ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "description": "Field to sort by (defaults to created_at)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort_order",
                        "in": "query",
                        "description": "Sort order (defaults to desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of records per page (defaults to 15)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early requests retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early requests retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized to view early requests"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Create a new early request",
                "operationId": "875097fdf3a62aa6a9316efbe6280a05",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID (defaults to authenticated user)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID (defaults to authenticated user's client)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "request_type",
                        "in": "query",
                        "description": "Type of early request",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "early_leaving",
                                "early_coming"
                            ]
                        }
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "description": "Reason for the early request",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000
                        }
                    },
                    {
                        "name": "in_datetime",
                        "in": "query",
                        "description": "In date and time",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "out_datetime",
                        "in": "query",
                        "description": "Out date and time (must be after in_datetime and on the same day)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Early request created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests/{early_request}": {
            "get": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Display a specific early request",
                "operationId": "bb7ebb0d215ff014d62cbe3693eb9b42",
                "parameters": [
                    {
                        "name": "early_request",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request retrieved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized to view this request"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Update an existing early request",
                "operationId": "e83c5ebda6e1ddaac3aac392a0b57e1e",
                "parameters": [
                    {
                        "name": "early_request",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "request_type",
                        "in": "query",
                        "description": "Type of early request",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "early_leaving",
                                "early_coming"
                            ]
                        }
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "description": "Reason for the early request",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000
                        }
                    },
                    {
                        "name": "in_datetime",
                        "in": "query",
                        "description": "In date and time",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "out_datetime",
                        "in": "query",
                        "description": "Out date and time (must be after in_datetime and on the same day)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Delete an early request",
                "operationId": "27d9b7bdbee58796a96b501d3f234b48",
                "parameters": [
                    {
                        "name": "early_request",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request cannot be deleted"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests/{earlyRequest}/approve": {
            "post": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Approve an early request",
                "operationId": "9aafe45c63622aa77480bdfac8cf75d1",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional approval notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request approved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request approved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request already processed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Approve an early request",
                "operationId": "07f44ce61283efef75c059798180c8f7",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional approval notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request approved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request approved successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request already processed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests/{earlyRequest}/reject": {
            "post": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Reject an early request",
                "operationId": "22b091614d3b6e1eb800ff0ee2ac312e",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional rejection notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request rejected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request rejected successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request already processed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Reject an early request",
                "operationId": "d23637346ce097ed4adaca814f85491a",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional rejection notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request rejected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request rejected successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request already processed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/early-requests/{earlyRequest}/cancel": {
            "post": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Cancel an early request",
                "operationId": "c70578c2544e2667dbe2e405bb380697",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional cancellation notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request cancelled successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request cannot be cancelled"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Early Requests"
                ],
                "summary": "Cancel an early request",
                "operationId": "0037cc437915c0a339f43d100dc8df73",
                "parameters": [
                    {
                        "name": "earlyRequest",
                        "in": "path",
                        "description": "ID of the early request",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Optional cancellation notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Early request cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Early request cancelled successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Unauthorized or request cannot be cancelled"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/elevenlabs-voice-key": {
            "get": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Get a list of Elevenlabs voice keys",
                "operationId": "f83c2593fa9255a7d3c696a2a261dc5b",
                "responses": {
                    "200": {
                        "description": "List of voice keys retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Create a new Elevenlabs voice key",
                "operationId": "3a77c550aa28e4b0b1f078071e1666ce",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "age",
                        "in": "query",
                        "description": "Age for the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender for the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "accent",
                        "in": "query",
                        "description": "Accent for the voice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "elevenlabs_secret_key",
                        "in": "query",
                        "description": "Elevenlabs secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Voice key created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Voice has been Added Successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/elevenlabs-voice-key/{id}": {
            "delete": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Delete an Elevenlabs voice key",
                "operationId": "e9a0db48ac58389d9229cbb404dd54d3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the voice key to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Voice key deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Voice has been deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Voice key not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Voice Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/save-elevenlabs-setting": {
            "post": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Save Elevenlabs settings",
                "operationId": "6cf29188a70fcabdea250d6dc44ad92c",
                "parameters": [
                    {
                        "name": "secret_key",
                        "in": "query",
                        "description": "Elevenlabs secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Elevenlabs Seeting has been Updated Successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-elevenlabs-setting": {
            "post": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Delete Elevenlabs settings",
                "operationId": "e6629275a53ba65d1b2a11f6a1a5442f",
                "responses": {
                    "200": {
                        "description": "Settings deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Elevenlabs Seeting has been fetch Successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-elevenlabs-setting": {
            "get": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Get Elevenlabs settings",
                "operationId": "cce07b11a11e507a3333b48d8c229fd8",
                "responses": {
                    "200": {
                        "description": "Settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Elevenlabs Seeting has been fetch Successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/elevenlabs-voice-key/{elevenlabs_voice_key}": {
            "get": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Show a single Elevenlabs voice key (resource show – placeholder, not currently implemented)",
                "operationId": "24c3488ac28d99c984147b6d7eb5a6a3",
                "parameters": [
                    {
                        "name": "elevenlabs_voice_key",
                        "in": "path",
                        "description": "Elevenlabs voice key ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Update an Elevenlabs voice key (resource update – placeholder, not currently implemented)",
                "operationId": "85ea61d62dd89a39e5fb4d8da498679b",
                "parameters": [
                    {
                        "name": "elevenlabs_voice_key",
                        "in": "path",
                        "description": "Elevenlabs voice key ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/elevenlabs-voice-key/{id}/preview": {
            "get": {
                "tags": [
                    "Elevenlabs"
                ],
                "summary": "Get the preview audio URL for a saved Elevenlabs voice",
                "description": "Fetches the preview audio URL for the given saved voice on demand from the Elevenlabs API, using the client's configured Elevenlabs secret key.",
                "operationId": "2c730c697d237661e3ae27ac478e0245",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the saved Elevenlabs voice key",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Preview URL retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "preview_url": {
                                            "type": "string",
                                            "example": "https://storage.googleapis.com/eleven-public-prod/premade/voices/xxxx/preview.mp3"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Voice not found, Elevenlabs secret key not configured, no preview available, or Elevenlabs request failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Voice Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-logs/data-table/get": {
            "post": {
                "tags": [
                    "Email Log"
                ],
                "summary": "List unified email logs for DataTables",
                "description": "Returns a DataTables-compatible JSON payload merging email activity from quotes, invoices, contracts, campaigns, SEO reports, and PPC reports for the authenticated user's client. Each row's `sent_at` is converted to the user's timezone. Pagination, search, and sort are handled by the DataTables.net protocol via the request body.",
                "operationId": "e078bf16aaf375017d6fedce76bea397",
                "requestBody": {
                    "description": "All fields are optional — an empty body (`{}`) is valid and returns the unfiltered first page (length=10, start=0). DataTables.net request payload plus optional module/date filters consumed directly by the controller.",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "draw": {
                                        "description": "DataTables draw counter — echoed back in the response.",
                                        "type": "integer"
                                    },
                                    "start": {
                                        "description": "Pagination offset (0-based).",
                                        "type": "integer"
                                    },
                                    "length": {
                                        "description": "Page size.",
                                        "type": "integer"
                                    },
                                    "search": {
                                        "description": "DataTables search payload (e.g., {value: 'foo'}).",
                                        "type": "object"
                                    },
                                    "order": {
                                        "description": "DataTables order payload (e.g., [{column: 0, dir: 'desc'}]).",
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "columns": {
                                        "description": "DataTables column metadata.",
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "module": {
                                        "description": "Optional module filter — exact match against the row's module label.",
                                        "type": "string",
                                        "enum": [
                                            "Quote",
                                            "Invoice",
                                            "Contract",
                                            "Campaign",
                                            "SEO Report",
                                            "PPC Report"
                                        ]
                                    },
                                    "date_from": {
                                        "description": "Optional inclusive lower bound on sent_at (YYYY-MM-DD).",
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "date_to": {
                                        "description": "Optional inclusive upper bound on sent_at (YYYY-MM-DD).",
                                        "type": "string",
                                        "format": "date"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables JSON payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "module": {
                                                        "description": "Source module: Quote, Invoice, Contract, Campaign, SEO Report, PPC Report",
                                                        "type": "string",
                                                        "example": "Quote"
                                                    },
                                                    "id": {
                                                        "description": "Primary key of the underlying record (estimate/invoice/contract/campaign_email/seo_report/ppc_report)",
                                                        "type": "integer"
                                                    },
                                                    "campaign_id": {
                                                        "description": "Campaign ID for Campaign rows; null for everything else",
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "subject": {
                                                        "type": "string"
                                                    },
                                                    "recipient": {
                                                        "description": "Pretty-formatted recipient: explicit sent_to if set, otherwise '{First Last} ({email})'",
                                                        "type": "string"
                                                    },
                                                    "sender": {
                                                        "description": "Pretty-formatted sender name, or 'System' if no user attached",
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "description": "Latest known engagement status, derived from per-module flags/activities",
                                                        "type": "string",
                                                        "enum": [
                                                            "Created",
                                                            "Sent",
                                                            "Delivered",
                                                            "Viewed",
                                                            "Clicked",
                                                            "Bounced",
                                                            "Pending"
                                                        ]
                                                    },
                                                    "sent_at": {
                                                        "description": "When the email was sent, converted to the caller's timezone",
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-logs/history/{module}/{id}": {
            "get": {
                "tags": [
                    "Email Log"
                ],
                "summary": "Get the email/engagement timeline for a single record",
                "description": "Returns the chronological timeline (Created → Sent → Delivered → Viewed → Clicked → Accepted/Bounced) for one record in one module. For `invoice` and `contract` the timeline is read straight from the corresponding *_activities table; for the other modules it's reconstructed from the record's status flags via the buildTimeline helper.",
                "operationId": "66f312c4b160132e5d891fd8ad759a8b",
                "parameters": [
                    {
                        "name": "module",
                        "in": "path",
                        "description": "Module name (case-insensitive). Recognized: quote, invoice, contract, campaign, task, 'seo report', 'ppc report'. Anything else returns an empty array.",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "quote"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Primary key of the record within the chosen module's table",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Timeline entries in ascending chronological order. Empty array when the module is not recognized or the record has no engagement events.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "status": {
                                                "description": "Created, Sent, Delivered, Viewed, Clicked, Accepted, or Bounced",
                                                "type": "string",
                                                "example": "Sent"
                                            },
                                            "created_at": {
                                                "description": "Event timestamp, timezone-converted",
                                                "type": "string"
                                            },
                                            "user": {
                                                "description": "Acting user name, or 'System'",
                                                "type": "string"
                                            },
                                            "ip": {
                                                "description": "Present on Viewed/Clicked rows for modules that capture it (campaign)",
                                                "type": "string",
                                                "nullable": true
                                            },
                                            "country": {
                                                "description": "Present on Viewed/Clicked rows for modules that capture it (campaign)",
                                                "type": "string",
                                                "nullable": true
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-logs/preview/{module}/{id}": {
            "get": {
                "tags": [
                    "Email Log"
                ],
                "summary": "Get the rendered email content for a single record",
                "description": "Looks up the most recent row in sent_emails whose headers reference this {module}/{id} pair (via the module-specific X-* header), then returns its subject + body. If the body isn't stored in the DB column (large emails), it's fetched from S3 using the path stored in the meta column.",
                "operationId": "c4dccaafd1f3a1b82a4df636e6e7a804",
                "parameters": [
                    {
                        "name": "module",
                        "in": "path",
                        "description": "Module name (case-insensitive). Maps to header: quote→X-Quote-ID, invoice→X-Invoice-ID, contract→X-Contract-ID, task→X-Lead-Task-ID, 'seo report'→X-SEO-Report-ID, 'ppc report'→X-PPC-Report-ID, campaign→X-Model-ID. Any other value returns 400.",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "invoice"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Primary key of the record within the chosen module's table",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email subject and HTML/text content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "subject": {
                                            "type": "string"
                                        },
                                        "content": {
                                            "description": "Rendered email body (HTML or text). Sourced from sent_emails.content if present, otherwise fetched from S3 via meta.content_file_path.",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid module",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid module"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No sent_emails row matches this module+id, or the row had no inline content and no S3 path",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Email record not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-category": {
            "get": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Get all email template categories",
                "operationId": "e25d7cb1c0c139829e8c9c0ce3bbb829",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "email_template_category": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Category not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Create a new email template category",
                "operationId": "eae15c0ef92c7b8a1abfcd052010740a",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the email template category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Marketing Templates"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Category Added Successfully"
                                        },
                                        "email_template_category": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-category/datatable/get": {
            "post": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Get email template categories for datatable",
                "operationId": "356b319133b848d328986d351d311ce7",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-category/{id}": {
            "get": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Get a specific email template category",
                "operationId": "ea9fa206c95a79051659648bbe00b6e1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the email template category",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "email_template_category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Category not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Update an existing email template category",
                "operationId": "4c52eb8c7f61670d5aa9877a4191f262",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the email template category",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "New name for the email template category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Marketing Templates"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Category updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Category Updated Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Category not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Email Template Category"
                ],
                "summary": "Delete an email template category",
                "operationId": "5b5bd0439c41111683cafb873adf45a7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the email template category to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Category deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Category Deleted Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Category not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-keyword": {
            "get": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Get all email template keywords",
                "operationId": "872e272cfb024861685f381aa69c2b3b",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "email_template_keywords": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Keywords not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Create a new email template keyword",
                "operationId": "00d9c3f5e3df23cd3fc25e4373c69470",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Keyword name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Keyword Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Keyword Added Successfully"
                                        },
                                        "email_template_category": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-keyword/datatable/get": {
            "post": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Get email template keywords for datatable",
                "operationId": "dc362ae3d0a9c86ab7b0b310000b4255",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/email-template-keyword/{id}": {
            "get": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Get a specific email template keyword",
                "operationId": "3bc728ad14a2fcb6b1d3c63a24afe554",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Email template keyword ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "email_template_category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Keyword not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Update a specific email template keyword",
                "operationId": "b35a5e8538cfc497f8548df986e6744e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Email template keyword ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Keyword name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Keyword Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Keyword Updated Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Keyword not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Email Template Keywords"
                ],
                "summary": "Delete a specific email template keyword",
                "operationId": "ec2d5f30a4f1136b50d88bda3fccf714",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Email template keyword ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email Template Keyword Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Template Keyword Deleted Successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Template Keyword not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get all estimate attachments",
                "operationId": "8b4cb948fa03619aa3494cb64d8c6a20",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Attachment Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Store a new estimate attachment",
                "operationId": "a2030797408ebdd57f0cf1631c46b2fa",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the attachment",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote Attachment Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Attachment Added Successfully"
                                        },
                                        "estimate_attachment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment/data-table/get": {
            "post": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get estimate attachments for data table",
                "operationId": "e344108397f1995d6c8e50521e939fd7",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-estimate/attachment": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get all estimate attachments",
                "operationId": "b67e286a1a11e9232f7ef4fbc06663b3",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment/{id}": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get a specific estimate attachment",
                "operationId": "3c539fad82c1f41b29a4fbfb81dfdf69",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate attachment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Attachment Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment/{estimate_attachment}": {
            "put": {
                "tags": [
                    "Estimate Attachment"
                ],
                "summary": "Update an estimate attachment (resource update – placeholder, not currently implemented)",
                "operationId": "2b6db8d642fe96c379ddc1aaa6793e6d",
                "parameters": [
                    {
                        "name": "estimate_attachment",
                        "in": "path",
                        "description": "Estimate attachment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Estimate Attachment"
                ],
                "summary": "Delete an estimate attachment and its stored file",
                "operationId": "239cfdae87ce2b581839cec934d5e047",
                "parameters": [
                    {
                        "name": "estimate_attachment",
                        "in": "path",
                        "description": "Estimate attachment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote Attachment Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Attachment Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Quote Attachment Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Attachment Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment-list": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get all estimate attachment lists",
                "operationId": "d16b4f2a3d4d398d66a19ecbea60691a",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Estimate attachment list not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Store a new estimate attachment list",
                "operationId": "175f811a401545515decaabcd72071c6",
                "parameters": [
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "ID of the estimate",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "estimate_attachment_id",
                        "in": "query",
                        "description": "Array of estimate attachment IDs",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Attachment List Added Successfully"
                                        },
                                        "estimate_attachment_list": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment-list/{id}": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get a specific estimate attachment list",
                "operationId": "50bea7834302ecdd069b62ea763d6f35",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate attachment list",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment_list": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Estimate attachment list not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Delete an estimate attachment list",
                "operationId": "7fd28177e6f883813f71230aff478942",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate attachment list to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Attachment List Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Estimate attachment list not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment-list/estimate/{id}": {
            "get": {
                "tags": [
                    "Estimate Attachments"
                ],
                "summary": "Get estimate attachment list using estimate ID",
                "operationId": "d4790629617e6ebbfeb97cdc42d621cb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_attachment_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Estimate attachment list not found or estimate ID not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-attachment-list/{estimate_attachment_list}": {
            "put": {
                "tags": [
                    "Estimate Attachment List"
                ],
                "summary": "Update an estimate attachment list (resource update – placeholder, not currently implemented)",
                "operationId": "7ee01c37cad12c24934993667d2bb845",
                "parameters": [
                    {
                        "name": "estimate_attachment_list",
                        "in": "path",
                        "description": "Estimate attachment list ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get all estimates",
                "operationId": "7956a535101ab17f5ab32e4254574140",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Create a new estimate",
                "operationId": "2844766753f26dc1d36565b278271609",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "estimate_date",
                        "in": "query",
                        "description": "Estimate date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valid_until",
                        "in": "query",
                        "description": "Valid until date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "note",
                        "in": "query",
                        "description": "Note",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "estimates_receiver_address",
                        "in": "query",
                        "description": "Receiver address",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tax_id",
                        "in": "query",
                        "description": "Tax ID percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "tax_id2",
                        "in": "query",
                        "description": "Second Tax ID percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "quote_reference",
                        "in": "query",
                        "description": "Quote reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Added Successfully"
                                        },
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/data-table/get": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get estimates data for datatable",
                "operationId": "7b65cbd2e04c85b9c07bd3d529be177e",
                "parameters": [
                    {
                        "name": "includes",
                        "in": "query",
                        "description": "Fields to include with LIKE operator",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "not_includes",
                        "in": "query",
                        "description": "Fields to exclude with NOT LIKE operator",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_equal_to",
                        "in": "query",
                        "description": "Fields that must be equal to specified values",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_equal_to",
                        "in": "query",
                        "description": "Fields that must not be equal to specified values",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_empty",
                        "in": "query",
                        "description": "Fields that must be empty",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_empty",
                        "in": "query",
                        "description": "Fields that must not be empty",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date fields to filter by exact date",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_between",
                        "in": "query",
                        "description": "Date fields to filter by date range",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_between",
                        "in": "query",
                        "description": "Numeric fields to filter by range",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_greater_than",
                        "in": "query",
                        "description": "Date fields to filter by greater than date",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_less_than",
                        "in": "query",
                        "description": "Date fields to filter by less than date",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "greater_than",
                        "in": "query",
                        "description": "Numeric fields to filter by greater than value",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "less_than",
                        "in": "query",
                        "description": "Numeric fields to filter by less than value",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "Field to order by",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order_dir",
                        "in": "query",
                        "description": "Order direction (asc or desc)",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records to return",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/get-lead-estimate-data/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get all estimates for a specific lead",
                "operationId": "ac7bfb0dee04c3fe1d17ec2ad9fd73c0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_lead_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/get-client-estimate-data/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get all estimates for a specific client",
                "operationId": "5761f7c3c38cc04f3d3911427b9eeb18",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_client_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get a specific estimate",
                "operationId": "7cb6bdb64026c3b22fb287e610c4b427",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Update an existing estimate",
                "operationId": "e230121c591f989745213ff6948db291",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "estimate_date",
                        "in": "query",
                        "description": "Estimate date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valid_until",
                        "in": "query",
                        "description": "Valid until date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "note",
                        "in": "query",
                        "description": "Note",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "estimates_receiver_address",
                        "in": "query",
                        "description": "Receiver address",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tax_id",
                        "in": "query",
                        "description": "Tax ID percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "tax_id2",
                        "in": "query",
                        "description": "Second Tax ID percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "quote_reference",
                        "in": "query",
                        "description": "Quote reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Updated Successfully."
                                        },
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Delete an estimate",
                "operationId": "0c7b4f0cc60b906426785d7a7bc7ea80",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/get-specific-estimate": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get a specific estimate without authentication",
                "operationId": "04f742db73c4a9f24573facd77f961de",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "uid",
                        "in": "query",
                        "description": "Estimate token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/update-estimate": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Update an estimate without authentication",
                "operationId": "7623e47c1865511ddbfe84cf36df0aa3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "estimate_date",
                        "in": "query",
                        "description": "Estimate date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "valid_until",
                        "in": "query",
                        "description": "Valid until date (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Estimate status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "accepted",
                                "declined"
                            ]
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Message",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Updated Successfully."
                                        },
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/accept/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Accept an estimate",
                "operationId": "335339685d369c2ed983075fcdda8f54",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Accepted Successfully."
                                        },
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-pdf/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Generate and download PDF for an estimate",
                "operationId": "8f021720ef23fc6b4ff41e090f0b810c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file download",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-print-pdf/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Generate and print PDF for an estimate",
                "operationId": "c4a73ba2fd1810146a6dcc0b46d36938",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file download",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-mail/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Send estimate via email",
                "operationId": "9bb19a36c5b8516a1c09772c3109a756",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found or Email sending failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/new-estimate-mail/{id}": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Send new estimate via email",
                "operationId": "b9fdf0adbed70903ffa9d113d3ecc16a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Recipient email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "description": "CC email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bcc",
                        "in": "query",
                        "description": "BCC email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "msg",
                        "in": "query",
                        "description": "Email message",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "replied_to_email_list",
                        "in": "query",
                        "description": "List of emails replied to",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Quote Not Found or Email sending failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-estimates-count": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get count of estimates",
                "operationId": "05f958cfc61fe35ca5824cded2cf7226",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "count": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/add-signature": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Add signature to an estimate",
                "operationId": "d759ddb5bb77c927d9c1d59a75230c46",
                "parameters": [
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Estimate status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "accepted",
                                "declined"
                            ]
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Signature file (base64 encoded)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Signature Added Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Quote Not Found or Error adding signature"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/without-auth-add-signature": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Add signature to an estimate without authentication",
                "operationId": "a3b284a036b51daca8e7b0eafd96a1cd",
                "parameters": [
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Estimate status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "accepted",
                                "declined"
                            ]
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Signature file (base64 encoded)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Signature Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Quote Not Found or Error adding signature"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate/duplicate/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Duplicate an estimate",
                "operationId": "d49e2b602289d5db75eaef6aa0635d92",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID to duplicate",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "Estima": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Duplicated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-to-invoice/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Convert an estimate to an invoice (GET alias)",
                "description": "Same behaviour as POST /api/estimate-to-invoice/{id}: creates a draft invoice from the quote in one transaction (no invoice row is left behind if a line has no price in the chosen currency). The invoice due date is the quote's valid-until when that is today or later, otherwise today's bill date. The quote's discount is carried over, except a Fixed discount when the invoice is issued in a different currency than the quote (no exchange rate to convert it with).",
                "operationId": "6fe03b0e05c6d6edd3acbc1e4c8794e7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID to convert to invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency to issue the invoice in. Must be one the client has enabled and every quote line must have a price in it. Defaults to the quote's own currency.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "USD",
                            "maxLength": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Draft invoice created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote to Invoice Successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Quote not found ({status, message}), malformed currency, or a line has no price in the chosen currency"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Convert an estimate to an invoice",
                "operationId": "8c206ee50de13c7c509d0c7a1450553c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID to convert to invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency to issue the invoice in. Must be one the client has enabled and every quote line must have a price in it. Defaults to the quote's own currency.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "USD"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote to Invoice Successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-app-list": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get list of estimates for mobile app",
                "operationId": "097a6a67a8f0f97c17beb3fd3f35cc8c",
                "parameters": [
                    {
                        "name": "includes",
                        "in": "query",
                        "description": "Fields to include with LIKE operator",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "not_includes",
                        "in": "query",
                        "description": "Fields to exclude with NOT LIKE operator",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_equal_to",
                        "in": "query",
                        "description": "Fields that must be equal to specified values",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_equal_to",
                        "in": "query",
                        "description": "Fields that must not be equal to specified values",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_empty",
                        "in": "query",
                        "description": "Fields that must be empty",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_empty",
                        "in": "query",
                        "description": "Fields that must not be empty",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date fields to filter by exact date",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_between",
                        "in": "query",
                        "description": "Date fields to filter by date range",
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records to return",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "current_page": {
                                            "type": "integer"
                                        },
                                        "last_page": {
                                            "type": "integer"
                                        },
                                        "per_page": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/quote-with-items/{id}": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get an estimate with its items",
                "operationId": "7ca20635158c797545b36dc2e35ee55b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "quote": {
                                            "properties": {
                                                "estimate": {
                                                    "type": "object"
                                                },
                                                "estimate_items_total": {
                                                    "type": "number"
                                                },
                                                "estimate_items_all_total": {
                                                    "type": "number"
                                                },
                                                "client_settings": {
                                                    "type": "object"
                                                },
                                                "estimate_creator_data": {
                                                    "type": "object"
                                                },
                                                "estimate_items_data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "estimate_tax_id": {
                                                    "type": "number"
                                                },
                                                "estimate_tax_id2": {
                                                    "type": "number"
                                                },
                                                "tax_id": {
                                                    "type": "number"
                                                },
                                                "tax_id2": {
                                                    "type": "number"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Quote Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/{id}/token-amount-received": {
            "put": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Update token amount received for an accepted estimate",
                "operationId": "2b8f86743c3442ff6be0fdc8e00d89c2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "token_amount_received": {
                                        "description": "Whether token amount has been received for the estimate",
                                        "type": "string",
                                        "example": "yes",
                                        "enum": [
                                            "yes",
                                            "no"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Token amount updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Token amount received updated successfully"
                                        },
                                        "estimate": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Estimate not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Estimate not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - estimate not accepted or validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Token amount can only be updated for accepted estimates"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/view-reports": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get estimate reports as a DataTables JSON response",
                "operationId": "089c8ece6a0244cc549976c852e8b3bb",
                "parameters": [
                    {
                        "name": "selectedClient",
                        "in": "query",
                        "description": "Filter by lead/client ID, or 'all' for all",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter estimates created on or after this date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter estimates created on or before this date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON of estimate reports"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/add-discount": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Add a discount to an estimate",
                "operationId": "2de263f50bb39943f3c3302ecfe7b139",
                "parameters": [
                    {
                        "name": "quote_id",
                        "in": "query",
                        "description": "ID of the estimate (quote)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "discount_type",
                        "in": "query",
                        "description": "Type of discount",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "Fixed",
                                "Percentage"
                            ]
                        }
                    },
                    {
                        "name": "discount",
                        "in": "query",
                        "description": "Discount value (minimum 0.1)",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float",
                            "minimum": 0.1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Discount applied successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "quote": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Discount applied successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/remove-discount": {
            "delete": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Remove the discount from an estimate",
                "operationId": "b497f8a7632741c99834a7d596a3eb61",
                "parameters": [
                    {
                        "name": "quote_id",
                        "in": "query",
                        "description": "ID of the estimate (quote)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Discount removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "quote": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Discount removed successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/revenue-statistics": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get revenue statistics for accepted estimates",
                "operationId": "79f9e451df968856895828ef819a08a5",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for statistics range (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for statistics range (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revenue statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "quote": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/revenue-reports": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get revenue reports as a DataTables JSON response",
                "operationId": "b8cbb9af07148a59fc64d6eefec0233d",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by acceptance start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by acceptance end date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter estimates by lead assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON of revenue reports"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates/{id}/currency": {
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Switch a quote to one of the client's other currencies",
                "description": "Re-derives every line's rate/total from its per-currency price map, so the whole quote — table, totals, PDF — renders in the new currency.",
                "operationId": "cbb18f33e83d5eaa8a9f842b301366e4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "currency"
                                ],
                                "properties": {
                                    "currency": {
                                        "description": "Target currency code; every quote line must have a price in it",
                                        "type": "string",
                                        "example": "USD"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Currency applied; the re-priced items are returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote currency updated successfully."
                                        },
                                        "currency": {
                                            "type": "string",
                                            "example": "USD"
                                        },
                                        "currency_symbol": {
                                            "type": "string",
                                            "example": "$"
                                        },
                                        "estimate_items": {
                                            "description": "The quote's items (with tax relation) re-priced in the new currency, in sort order",
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, quote not found ({estimate: \"Quote Not Found\"}), or an item has no price in the target currency"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/quote-settings": {
            "get": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Get the client's quote display settings",
                "operationId": "7c8c67fa8fa499b62015001813d97f45",
                "responses": {
                    "200": {
                        "description": "Resolved settings (stored values with defaults filled in)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "quote_settings": {
                                            "$ref": "#/components/schemas/QuoteSettings"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimates"
                ],
                "summary": "Save the client's quote display settings",
                "description": "Both flags are required — the modal always sends the full state. The change is logged as its own quote_settings activity entry.",
                "operationId": "6f2fb1377961dfe954d8d0349d3ae16e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/QuoteSettings"
                                    },
                                    {
                                        "required": [
                                            "show_logo_footer_on_all_pages",
                                            "show_quote_parties"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settings stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote settings updated."
                                        },
                                        "quote_settings": {
                                            "$ref": "#/components/schemas/QuoteSettings"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or client settings row not found ({success: false, message})"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates-items": {
            "get": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "List estimate items (resource index – placeholder, not currently implemented)",
                "operationId": "5440710c77e99daa0ba78b2b14e016f6",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Store a new estimate item",
                "operationId": "2fb9573310973e5366be62a0b0999901",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the estimate item",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Website Development"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the item",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "1"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the item",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "100"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of an existing item (optional, will be stored for custom field mapping)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional, calculated if not provided)",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "example": "100"
                        }
                    },
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "ID of the estimate",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote Item Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Item Added Successfully"
                                        },
                                        "estimate_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates-items/{id}": {
            "get": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Get a specific estimate item with custom fields",
                "operationId": "bbfa79a2b6b0a142df88a013a9fe6739",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate item",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "estimate_items": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": "1"
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Website Development"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Custom website development service"
                                                },
                                                "quantity": {
                                                    "type": "number",
                                                    "example": "1"
                                                },
                                                "rate": {
                                                    "type": "number",
                                                    "example": "100.00"
                                                },
                                                "total": {
                                                    "type": "number",
                                                    "example": "100.00"
                                                },
                                                "estimate_id": {
                                                    "type": "integer",
                                                    "example": "1"
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": "1"
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Project Type"
                                                            },
                                                            "field_type": {
                                                                "type": "string",
                                                                "example": "text"
                                                            },
                                                            "value": {
                                                                "type": "string",
                                                                "example": "E-commerce"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote Item Not Found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Update an existing estimate item",
                "operationId": "25c0d53e10ae61185f85b25d4712a030",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate item",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the estimate item",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Website Development"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the item",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "1"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the item",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "100"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional, calculated if not provided)",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "example": "100"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote Item Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Item Updated Successfully."
                                        },
                                        "estimate_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote Item Not Found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Delete an estimate item",
                "operationId": "d90def2d5b1c8eeb772eeb4e89271e89",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the estimate item to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote Item Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Quote Item Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote Item Not Found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates-items/get-item-data/{id}": {
            "get": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Get specific item data by ID with custom fields",
                "operationId": "d5072f6902bfd20e97139d45c88acb21",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the item",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": "1"
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Website Development"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Custom website development service"
                                                },
                                                "quantity": {
                                                    "type": "number",
                                                    "example": "1"
                                                },
                                                "rate": {
                                                    "type": "number",
                                                    "example": "100.00"
                                                },
                                                "total": {
                                                    "type": "number",
                                                    "example": "100.00"
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": "1"
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": "1"
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Project Type"
                                                            },
                                                            "field_type": {
                                                                "type": "string",
                                                                "example": "text"
                                                            },
                                                            "value": {
                                                                "type": "string",
                                                                "example": "E-commerce"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item Not Found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates-items/get-estimate-items-data": {
            "post": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Get all estimate items data for a specific estimate",
                "operationId": "409b532e924d591ebd4e40f90d7a167d",
                "parameters": [
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "ID of the estimate",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Quote Item Not Found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/items/get-client-items-data": {
            "get": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Get all client items data with custom fields",
                "operationId": "1ced68810f42f09cc9420835d7b30783",
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "Enable filtering (returns max 10 records)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "false",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term to filter items by title or description",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "website"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": "1"
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Website Development"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "example": "Custom website development service"
                                                    },
                                                    "quantity": {
                                                        "type": "number",
                                                        "example": "1"
                                                    },
                                                    "rate": {
                                                        "type": "number",
                                                        "example": "100.00"
                                                    },
                                                    "total": {
                                                        "type": "number",
                                                        "example": "100.00"
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": "1"
                                                    },
                                                    "custom_fields": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer",
                                                                    "example": "1"
                                                                },
                                                                "title": {
                                                                    "type": "string",
                                                                    "example": "Project Type"
                                                                },
                                                                "field_type": {
                                                                    "type": "string",
                                                                    "example": "text"
                                                                },
                                                                "value": {
                                                                    "type": "string",
                                                                    "example": "E-commerce"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Items Not Found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimates-items/order-change": {
            "post": {
                "tags": [
                    "Estimate Items"
                ],
                "summary": "Change the order of estimate items",
                "operationId": "12b04a9be542ed3b4908bebe0749df2a",
                "parameters": [
                    {
                        "name": "order_change",
                        "in": "query",
                        "description": "Array of estimate item IDs in the new order",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "estimate_id",
                        "in": "query",
                        "description": "ID of the estimate",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order changed successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-cat/data-table": {
            "post": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Get event categories for datatable",
                "operationId": "c1827f7ca24fb41a729aa0bade6325a9",
                "responses": {
                    "200": {
                        "description": "Event categories retrieved successfully for datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-cat": {
            "get": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Get all event categories",
                "operationId": "8dfd42df4ab0b99aa1a867cecc100790",
                "responses": {
                    "200": {
                        "description": "Event categories retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "categories": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Create a new event category",
                "operationId": "b1ba0c8196f2890e7bcb49e393a5942a",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Category title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category added successfully"
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-cat/{id}": {
            "get": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Get a specific event category",
                "operationId": "230625b9e4390cbae29b50b6cd835ed1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event category retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event category not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Update an existing event category",
                "operationId": "45f31c8fa9ce468faa2dbb2786159138",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Category title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event category updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category updated successfully"
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event category not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Event Categories"
                ],
                "summary": "Delete an event category",
                "operationId": "93e329bddce0b78b140c23e218aee11d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event category ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event category deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category deleted successfully"
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event category not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Category not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/list": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "Get Google Calendar events between start_date and end_date",
                "operationId": "9ff167aab801a3950ef1522952030cb3",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for events filter (YYYY-MM-DD format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-05-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for events filter (YYYY-MM-DD format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-05-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of Google calendar events",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "colors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/check-google-calendar-client": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "Check Google Calendar client authorization and get primary calendar ID",
                "operationId": "78a11843c02ee011c8fc5b17a7e916aa",
                "responses": {
                    "200": {
                        "description": "Google Calendar client status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "oneOf": [
                                        {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "profile": {
                                                    "type": "string",
                                                    "example": "primary_calendar_id"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "auth_link": {
                                                    "type": "string",
                                                    "example": "https://accounts.google.com/o/oauth2/auth"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/create": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Create an event on Google Calendar",
                "description": "Creates a new event on Google Calendar with the provided details",
                "operationId": "createEventOnGoogle",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "start_date"
                                ],
                                "properties": {
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    },
                                    "category_id": {
                                        "description": "Category ID of the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "color_id": {
                                        "description": "Color ID for the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "location": {
                                        "description": "Location of the event",
                                        "type": "string",
                                        "example": "123 Main St, London"
                                    },
                                    "invite_emails": {
                                        "description": "List of email addresses to invite",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "user@example.com"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event created successfully on Google Calendar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event created successfully on Google Calendar."
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Google Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or quota exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "example": "Daily Events Quota Exceeded, Please Try Adding the Event on Another Day"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/get": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Get Google Calendar event details with additional local info",
                "operationId": "61b30f2eeb35e77fa2f86e5442f45ec7",
                "parameters": [
                    {
                        "name": "event_id",
                        "in": "query",
                        "description": "The Google Calendar event ID to fetch",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "abcd1234xyz"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event details fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "type": "object"
                                        },
                                        "user_auth": {
                                            "type": "integer",
                                            "example": 123
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error: event_id required"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/update": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Update an event on Google Calendar",
                "description": "Updates an existing event on Google Calendar with the provided details",
                "operationId": "updateEventOnGoogle",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id",
                                    "title",
                                    "start_date"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Google Calendar event ID",
                                        "type": "string",
                                        "example": "abcd1234xyz"
                                    },
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Updated meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss updated project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    },
                                    "color_id": {
                                        "description": "Color ID for the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "location": {
                                        "description": "Location of the event",
                                        "type": "string",
                                        "example": "123 Main St, London"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event updated successfully on Google Calendar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event has been updated successfully."
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Google Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The id field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/delete": {
            "delete": {
                "tags": [
                    "Event"
                ],
                "summary": "Delete an event from Google Calendar",
                "description": "Deletes an existing event from Google Calendar",
                "operationId": "deleteEventFromGoogle",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Google Calendar event ID",
                                        "type": "string",
                                        "example": "abcd1234xyz"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Google Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Permission denied",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have not permission to delete event."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The id field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "List all events",
                "description": "Returns a list of all events for the authenticated user's client",
                "operationId": "listEvents",
                "parameters": [
                    {
                        "name": "cat_id",
                        "in": "query",
                        "description": "Filter events by category ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "member_id",
                        "in": "query",
                        "description": "Filter events by member ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering events (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering events (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Events retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "title": {
                                                "type": "string",
                                                "example": "Meeting with client"
                                            },
                                            "description": {
                                                "type": "string",
                                                "example": "Discuss project requirements"
                                            },
                                            "start_date": {
                                                "type": "string",
                                                "format": "date-time",
                                                "example": "2023-01-15 10:00:00"
                                            },
                                            "end_date": {
                                                "type": "string",
                                                "format": "date-time",
                                                "example": "2023-01-15 11:00:00"
                                            },
                                            "category_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "user_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 101
                                            },
                                            "lead_id": {
                                                "type": "integer",
                                                "example": 0
                                            },
                                            "color": {
                                                "type": "string",
                                                "example": "#FF5733"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Create a new event",
                "description": "Creates a new event with the provided details",
                "operationId": "storeEvent",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "start_date"
                                ],
                                "properties": {
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event (Y-m-d H:i format)",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event (Y-m-d H:i format)",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    },
                                    "category_id": {
                                        "description": "Category ID of the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "lead_id": {
                                        "description": "Lead ID associated with the event (0 if none)",
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "color_id": {
                                        "description": "Color for the event",
                                        "type": "string",
                                        "example": "#FF5733"
                                    },
                                    "tag_id": {
                                        "description": "Tag ID for the event",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Meeting with client"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Discuss project requirements"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 10:00:00"
                                                },
                                                "end_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 11:00:00"
                                                },
                                                "category_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 101
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "example": "#FF5733"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Added Successfully."
                                        },
                                        "event_count": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "totalAllow": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or quota exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "example": "Daily Events Quota Exceeded, Please Try Adding the Event on Another Day"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/{id}": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "Get a specific event",
                "description": "Returns detailed information about a specific event",
                "operationId": "showEvent",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "event": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Meeting with client"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Discuss project requirements"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 10:00:00"
                                                },
                                                "end_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 11:00:00"
                                                },
                                                "category_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 101
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "example": "#FF5733"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "event_attachments": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "example": "image"
                                                            },
                                                            "path": {
                                                                "type": "string",
                                                                "example": "https://example.com/storage/event-files/file.jpg"
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "example": "file.jpg"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "lead_contact_list": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "first_name": {
                                                                "type": "string",
                                                                "example": "John"
                                                            },
                                                            "last_name": {
                                                                "type": "string",
                                                                "example": "Doe"
                                                            },
                                                            "email": {
                                                                "type": "string",
                                                                "example": "john.doe@example.com"
                                                            },
                                                            "mobile_number": {
                                                                "type": "string",
                                                                "example": "+441234567890"
                                                            },
                                                            "is_primary_contact": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "is_spouse_contact": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "contact_type_id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "contact_type": {
                                                                "type": "string",
                                                                "example": "Customer"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "user_auth": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "slot_msg": {
                                            "type": "string",
                                            "example": "Available"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Event not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "event": {
                                            "type": "string",
                                            "example": "No Event Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Update an existing event",
                "description": "Updates an existing event with the provided details",
                "operationId": "updateEvent",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "start_date"
                                ],
                                "properties": {
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Updated meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss updated project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event (Y-m-d H:i format)",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event (Y-m-d H:i format)",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    },
                                    "category_id": {
                                        "description": "Category ID of the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "lead_id": {
                                        "description": "Lead ID associated with the event (0 if none)",
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "color_id": {
                                        "description": "Color for the event",
                                        "type": "string",
                                        "example": "#FF5733"
                                    },
                                    "tag_id": {
                                        "description": "Tag ID for the event",
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "event": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Updated meeting with client"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Discuss updated project requirements"
                                                },
                                                "start_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 10:00:00"
                                                },
                                                "end_date": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-15 11:00:00"
                                                },
                                                "category_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 101
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "color": {
                                                    "type": "string",
                                                    "example": "#FF5733"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or event not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The title field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Event"
                ],
                "summary": "Delete an event",
                "description": "Deletes an existing event",
                "operationId": "destroyEvent",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Event Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/google/logout": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Logout from Google Calendar",
                "description": "Logs out the user from Google Calendar by deleting the stored token",
                "operationId": "googleCalendarLogout",
                "responses": {
                    "200": {
                        "description": "Successfully logged out",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/list": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "List events from Outlook Calendar",
                "description": "Returns a list of events from the user's Outlook Calendar",
                "operationId": "outlookEventsList",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering events (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering events (Y-m-d format)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Events retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Outlook Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The start_date field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/create": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Create an event on Outlook Calendar",
                "description": "Creates a new event on Outlook Calendar with the provided details",
                "operationId": "createEventOnOutlook",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "start_date",
                                    "description"
                                ],
                                "properties": {
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    },
                                    "category_id": {
                                        "description": "Category ID of the event",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "lead_id": {
                                        "description": "Lead ID associated with the event (0 if none)",
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event created successfully on Outlook Calendar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event has been added successfully."
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Outlook Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The title field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/update": {
            "put": {
                "tags": [
                    "Event"
                ],
                "summary": "Update an event on Outlook Calendar",
                "description": "Updates an existing event on Outlook Calendar with the provided details",
                "operationId": "updateEventOnOutlook",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id",
                                    "title",
                                    "start_date",
                                    "description"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Outlook Calendar event ID",
                                        "type": "string",
                                        "example": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAENAAAiIsqMbYjsT5e-T7KzowPTAAAYbuK-AAA="
                                    },
                                    "title": {
                                        "description": "Title of the event",
                                        "type": "string",
                                        "example": "Updated meeting with client"
                                    },
                                    "description": {
                                        "description": "Description of the event",
                                        "type": "string",
                                        "example": "Discuss updated project requirements"
                                    },
                                    "start_date": {
                                        "description": "Start date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 10:00"
                                    },
                                    "end_date": {
                                        "description": "End date and time of the event",
                                        "type": "string",
                                        "format": "date-time",
                                        "example": "2023-01-15 11:00"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event updated successfully on Outlook Calendar",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Updated Successfully."
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Outlook Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The id field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/delete": {
            "delete": {
                "tags": [
                    "Event"
                ],
                "summary": "Delete an event from Outlook Calendar",
                "description": "Deletes an existing event from Outlook Calendar",
                "operationId": "deleteEventFromOutlook",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Outlook Calendar event ID",
                                        "type": "string",
                                        "example": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAENAAAiIsqMbYjsT5e-T7KzowPTAAAYbuK-AAA="
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event deleted Successfully."
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized or Outlook Calendar authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The id field is required."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/logout": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Logout from Outlook Calendar",
                "description": "Logs out the user from Outlook Calendar by deleting the stored token",
                "operationId": "outlookCalendarLogout",
                "responses": {
                    "200": {
                        "description": "Successfully logged out",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/outlook/oauth2-callback": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "Handle Outlook OAuth2 callback and store the access token",
                "operationId": "7be372828dce2bb5845ff5a90e6fb1b3",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by Microsoft after consent",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token has been generated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "OAuth2 exchange failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/studio-appointment-datatable": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Get studio appointments as a DataTables JSON response",
                "operationId": "7afca36471fb86e952422af4890b9328",
                "parameters": [
                    {
                        "name": "contact_type_id",
                        "in": "query",
                        "description": "Filter by contact type ID (use 'all' to skip)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "appointment_date_range",
                        "in": "query",
                        "description": "Date range filter with from_date and to_date keys",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON of studio appointments"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-appointment-attachment": {
            "post": {
                "tags": [
                    "Event"
                ],
                "summary": "Delete a specific attachment from an appointment",
                "operationId": "4df3e51bdd20a769b0f2dfe5cf276401",
                "parameters": [
                    {
                        "name": "appointment_id",
                        "in": "query",
                        "description": "ID of the appointment (event)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Name of the attachment file to remove",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attachment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "deleted_file_name": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Attachment Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Appointment or attachment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-cancel/{id}": {
            "get": {
                "tags": [
                    "Event"
                ],
                "summary": "Cancel an event",
                "operationId": "a4504a6dada25437833e5999a70cf08f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event to cancel",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "error": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Cancelled Successfully"
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event/{event}": {
            "put": {
                "tags": [
                    "Event"
                ],
                "summary": "Update the specified event",
                "operationId": "63c8dcaf4a7a3fcd2e906c990318bf7d",
                "parameters": [
                    {
                        "name": "event",
                        "in": "path",
                        "description": "ID of the event to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Event title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Event start date/time (Y-m-d H:i)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "2025-05-01 09:00"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Event end date/time (Y-m-d H:i, after or equal to start_date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "2025-05-01 10:00"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Event description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "Event location",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invite_emails",
                        "in": "query",
                        "description": "Comma or semicolon separated list of invitee emails",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "color_id",
                        "in": "query",
                        "description": "Color ID for the event",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "tag_id",
                        "in": "query",
                        "description": "Tag ID for the event",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "description": "Category ID for the event",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_contact_id",
                        "in": "query",
                        "description": "Lead contact ID for the event",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "event_attachments",
                        "in": "query",
                        "description": "Event attachment files",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No event found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-setting": {
            "get": {
                "tags": [
                    "Event Settings"
                ],
                "summary": "Get event settings for the authenticated user's client",
                "operationId": "d8caf6739341257b221b3dd095546bcb",
                "responses": {
                    "200": {
                        "description": "Event settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "setting": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No event settings found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "example": "No Event Setting Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Event Settings"
                ],
                "summary": "Create a new event setting",
                "operationId": "09a96bd161172995a3ab2b52efce03aa",
                "parameters": [
                    {
                        "name": "category_wise_daily_limit",
                        "in": "query",
                        "description": "Category wise daily limit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_wise_per_slot_limit",
                        "in": "query",
                        "description": "Category wise per slot limit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event setting created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "setting": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "Setting save successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Failed to create event setting",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "No Event Setting Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-setting/{id}": {
            "get": {
                "tags": [
                    "Event Settings"
                ],
                "summary": "Get a specific event setting",
                "operationId": "3d7e95b8edb341faa5e5655896f9f0bd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event setting retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "setting": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event setting not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "No Event Setting Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Event Settings"
                ],
                "summary": "Update an existing event setting",
                "operationId": "266545ff69fdcfc03ea84429ed2e7eca",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Event setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_wise_daily_limit",
                        "in": "query",
                        "description": "Category wise daily limit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_wise_per_slot_limit",
                        "in": "query",
                        "description": "Category wise per slot limit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event setting updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "setting": {
                                            "type": "object"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "Setting save successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event setting not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "example": "No Event Setting Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-setting/{event_setting}": {
            "delete": {
                "tags": [
                    "Event Setting"
                ],
                "summary": "Delete an event setting (resource destroy – placeholder, not currently implemented)",
                "operationId": "83afbf2a9e72541f7e47d73e17eaca9c",
                "parameters": [
                    {
                        "name": "event_setting",
                        "in": "path",
                        "description": "Event setting ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-tag": {
            "get": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Get all event tags",
                "operationId": "3bd59a48506f5acd3850096338685d64",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Create a new event tag",
                "operationId": "6fa0652716b0332fc423b9314302ef32",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the event tag",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Important"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the event tag",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "For important events"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "description": "Color code for the event tag",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "#FF0000"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event tag created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Added Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-tag/data-table": {
            "post": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Get event tags for datatable",
                "operationId": "d660c749905bc3d2f6cea8eb99f76aa2",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-tag/{id}": {
            "get": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Get a specific event tag",
                "operationId": "02d14669e63d8b89bb17d04060782788",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event tag",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Event tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Update a specific event tag",
                "operationId": "ca29bd5df7d54f7f9d07e3628eb73c1d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event tag",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the event tag",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Important"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the event tag",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "For important events"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "description": "Color code for the event tag",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "#FF0000"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status of the event tag",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "active"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event tag updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Updated Successfully."
                                        },
                                        "tag": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Event tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Event Tags"
                ],
                "summary": "Delete a specific event tag",
                "operationId": "63764e1110006cccc463a397a33c8757",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the event tag",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event tag deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Event tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/facebook-callback": {
            "get": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Facebook webhook verification callback",
                "operationId": "3eb29e8aef60b06d9db921ff6d7b3080",
                "parameters": [
                    {
                        "name": "hub_challenge",
                        "in": "query",
                        "description": "Challenge string sent by Facebook",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "hub_verify_token",
                        "in": "query",
                        "description": "Verification token for Facebook webhook",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Returns the challenge string if verification is successful"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Process Facebook lead data from webhook",
                "operationId": "002f82db5dbffb1e96058f521ca4e44b",
                "parameters": [
                    {
                        "name": "entry",
                        "in": "query",
                        "description": "Facebook webhook entry data containing lead information",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead data processed successfully"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/facebook-accesstoken-insert": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Insert or update Facebook access token",
                "operationId": "d0c49b8d7562fa301fbc5fbb156e1394",
                "parameters": [
                    {
                        "name": "facebook_access_token",
                        "in": "query",
                        "description": "Facebook access token to store",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Facebook access token inserted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "facebook_token_inserted_id": {
                                            "type": "integer"
                                        },
                                        "facebook_access_token": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error inserting Facebook access token"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/facebook-accesstoken-update-person-details": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Update Facebook access token details",
                "operationId": "fb3d88c15df0eebabbb4d71bac4ac7d1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Facebook access token ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "account_id",
                        "in": "query",
                        "description": "Account ID to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Facebook access token details updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "facebook_token_inserted_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error updating Facebook access token details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/facebook-accesstoken-delete": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Delete Facebook access token",
                "operationId": "cfff3660690332a67655bd2651efe507",
                "parameters": [
                    {
                        "name": "facebook_access_token",
                        "in": "query",
                        "description": "Facebook access token to delete",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Facebook access token deleted successfully"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-facebook-user-details": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Get Facebook user details by access token",
                "operationId": "41bbf232a3628d5d668edcf95d593a67",
                "parameters": [
                    {
                        "name": "facebook_access_token",
                        "in": "query",
                        "description": "Facebook access token to get user details",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Facebook user details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "facebook_user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error retrieving Facebook user details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-facebook-accesstoken": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Get Facebook access token for authenticated user's client",
                "operationId": "a263b5a87c7aa4b1251de98f787c93df",
                "responses": {
                    "200": {
                        "description": "Facebook access token retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "facebook_access_token": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Facebook access token not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/facebook-pages-insert": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Insert Facebook pages for authenticated user's client",
                "operationId": "96401d9e83e2b34cb4942b8912473fee",
                "parameters": [
                    {
                        "name": "pages",
                        "in": "query",
                        "description": "Array of Facebook pages to insert",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "access_token": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Facebook pages inserted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/getfacebook_token": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Get Facebook access token for a specific page",
                "operationId": "156d1cda8a3b220ac156830650f88504",
                "responses": {
                    "200": {
                        "description": "Facebook access token retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "facebook_access_token": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/generate-live-long-accesstoken": {
            "post": {
                "tags": [
                    "Facebook Integration"
                ],
                "summary": "Generate a long-lived Facebook access token",
                "operationId": "88bf4223d5c6155ba1c3f49b0e4d00e8",
                "parameters": [
                    {
                        "name": "accessToken",
                        "in": "query",
                        "description": "Short-lived access token to exchange for a long-lived token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Long-lived access token generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "access_token": {
                                            "type": "string"
                                        },
                                        "token_type": {
                                            "type": "string",
                                            "example": "bearer"
                                        },
                                        "expires_in": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/download-attachment": {
            "get": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Download feedback attachment",
                "operationId": "08174002e490bc7838fc2869dacd2a21",
                "parameters": [
                    {
                        "name": "feedback_id",
                        "in": "query",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachment_number",
                        "in": "query",
                        "description": "Attachment number (1-based index)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback": {
            "get": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "List feedbacks with filters and pagination",
                "operationId": "2834bca01005e2e9e6cd44c95c2f8e75",
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Filter by category",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Filter by priority",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "feedback_type",
                        "in": "query",
                        "description": "Filter by feedback type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search across subject, description and notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedbacks retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Submit a new feedback",
                "operationId": "70160908046e46dedfc16e7a0d5bef50",
                "parameters": [
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Feedback category",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Feedback subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Feedback description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Additional notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "feedback_type",
                        "in": "query",
                        "description": "Feedback type",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Priority level",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachments",
                        "in": "query",
                        "description": "Attachment files (max 5, 10MB each)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Feedback submitted successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Failed to submit feedback"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/data-table/get": {
            "post": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Get feedbacks data for DataTable",
                "operationId": "3a2f5bab731dec34af27fc89f49da28d",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Filter by category",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Filter by priority",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "feedback_type",
                        "in": "query",
                        "description": "Filter by feedback type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTable payload"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/statistics": {
            "get": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Get feedback statistics",
                "operationId": "a3134e9e4ec8db0338d3fa9a3bf9d76f",
                "responses": {
                    "200": {
                        "description": "Feedback statistics retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/enums": {
            "get": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Get feedback enum values (categories, types, priorities, statuses)",
                "operationId": "838553d3af60269fe99da9e805d81511",
                "responses": {
                    "200": {
                        "description": "Enum values retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/delete-attachment": {
            "delete": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Delete an individual feedback attachment",
                "operationId": "bc16a4cb8e2b3ceba0b85994820dc02b",
                "parameters": [
                    {
                        "name": "feedback_id",
                        "in": "query",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Zero-based attachment index to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attachment deleted successfully"
                    },
                    "403": {
                        "description": "Not authorized to delete attachment"
                    },
                    "404": {
                        "description": "Attachment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/{feedback}": {
            "put": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Update an existing feedback",
                "operationId": "22e83d2b573e7d20ab92b2739e3d6cdd",
                "parameters": [
                    {
                        "name": "feedback",
                        "in": "path",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "description": "Feedback category",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Feedback subject",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Feedback description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Additional notes",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "feedback_type",
                        "in": "query",
                        "description": "Feedback type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Priority level",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status value",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachments",
                        "in": "query",
                        "description": "Additional attachment files (max 5)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback updated successfully"
                    },
                    "403": {
                        "description": "Not authorized to update feedback"
                    },
                    "404": {
                        "description": "Feedback not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Delete a feedback",
                "operationId": "bb3e70dee69b408e3cd4bb532e2f2af4",
                "parameters": [
                    {
                        "name": "feedback",
                        "in": "path",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback deleted successfully"
                    },
                    "403": {
                        "description": "Not authorized to delete feedback"
                    },
                    "404": {
                        "description": "Feedback not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/{feedback}/assign": {
            "post": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Assign feedback to a user",
                "operationId": "51164fe818a274d8f48cf78f5ce0ced4",
                "parameters": [
                    {
                        "name": "feedback",
                        "in": "path",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign feedback to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "comment",
                        "in": "query",
                        "description": "Optional assignment comment",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback assigned successfully"
                    },
                    "403": {
                        "description": "Not authorized to assign feedback"
                    },
                    "404": {
                        "description": "Feedback not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/{feedback}/resolve": {
            "post": {
                "tags": [
                    "Employee Feedback"
                ],
                "summary": "Resolve a feedback with resolution notes",
                "operationId": "79f35789e5de1550a147277cd60e4e17",
                "parameters": [
                    {
                        "name": "feedback",
                        "in": "path",
                        "description": "Feedback ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "resolution_notes",
                        "in": "query",
                        "description": "Resolution notes",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Resolution status (resolved, closed, or rejected)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "resolved",
                                "closed",
                                "rejected"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback resolved successfully"
                    },
                    "403": {
                        "description": "Not authorized to resolve feedback"
                    },
                    "404": {
                        "description": "Feedback not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival": {
            "get": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Get all festival leaves for the year",
                "operationId": "bee05749ed39dd74435ade14098cfe22",
                "responses": {
                    "200": {
                        "description": "List of festival leaves retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "festivas": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Create a new festival leave",
                "operationId": "1840857f77f86f2a23fe9f731e0fcc71",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Christmas"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date of the festival leave (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-25"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the festival leave",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Christmas holiday"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Festival leave created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave added successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival/{id}": {
            "get": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Get a specific festival leave",
                "operationId": "dc5012c58f7ee7fafd27bf894843588a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Festival leave details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Festival Leave Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Update a festival leave",
                "operationId": "e6f969dc96123635f9cff78dc832cd42",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Christmas"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date of the festival leave (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-25"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the festival leave",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Christmas holiday"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Festival leave updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Festival Leave Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Festival Leave Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Delete a festival leave",
                "operationId": "2ee5dd1a6ef0a58e6e18bf51d44643a6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Festival leave deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Festival Leave Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Festival Leave Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival-leave-status-update": {
            "post": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Update festival leave status",
                "operationId": "2d841debb0affe638f84f4830cd437b2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status of the festival leave (0 or 1)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1,
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Festival leave status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave update successfully."
                                        },
                                        "leave": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival-leave-add-member": {
            "post": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Add a member to festival leave",
                "operationId": "cf4e5f7fcc4c079473156ca00592092c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user to add",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Member added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Member added successfully."
                                        },
                                        "leave": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival-leave-remove-member": {
            "post": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Remove a member from festival leave",
                "operationId": "320aa6d7e70e58d86aa267fee245c77a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the festival leave",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "member_id",
                        "in": "query",
                        "description": "ID of the member to remove",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Member removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Member removed successfully."
                                        },
                                        "leave": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Festival leave not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/festival-leave-widget-current-month": {
            "get": {
                "tags": [
                    "Festival Leave"
                ],
                "summary": "Get festival leave widget data for current month",
                "operationId": "cd5b1902849be04deaaa9413339e3b39",
                "responses": {
                    "200": {
                        "description": "Festival leave widget data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "festivas": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forms": {
            "get": {
                "tags": [
                    "Forms"
                ],
                "summary": "Get all forms for the authenticated user's client",
                "operationId": "e68ec1efcd629f69e16cd2bf8dca7c04",
                "responses": {
                    "200": {
                        "description": "List of forms retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "forms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Create a new form",
                "operationId": "afc5d3cbec59b71e09122e37282db0f2",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Form title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Contact Form"
                        }
                    },
                    {
                        "name": "submit_title",
                        "in": "query",
                        "description": "Form submit button text",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Submit"
                        }
                    },
                    {
                        "name": "form_data_json",
                        "in": "query",
                        "description": "Form data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_style_json",
                        "in": "query",
                        "description": "Form style in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "embeded_code",
                        "in": "query",
                        "description": "Embedded code for the form",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "Unique form identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_logo",
                        "in": "query",
                        "description": "Form logo (base64 encoded)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Forms Added Successfully"
                                        },
                                        "forms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forms/data-table/get": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Get forms data for DataTables",
                "operationId": "50f21ca1f283f67eb7eff57e0071d87d",
                "responses": {
                    "200": {
                        "description": "Forms data for DataTables",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forms/{id}": {
            "get": {
                "tags": [
                    "Forms"
                ],
                "summary": "Get a specific form by ID",
                "operationId": "45cc9eec465dc22babbb745d2c2a9881",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "string",
                                            "example": "No Forms Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Forms"
                ],
                "summary": "Update an existing form",
                "operationId": "ada70114966825c2f75bdaef691db3b1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Form title",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Contact Form"
                        }
                    },
                    {
                        "name": "submit_title",
                        "in": "query",
                        "description": "Form submit button text",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Submit"
                        }
                    },
                    {
                        "name": "form_data_json",
                        "in": "query",
                        "description": "Form data in JSON format",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_style_json",
                        "in": "query",
                        "description": "Form style in JSON format",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "embeded_code",
                        "in": "query",
                        "description": "Embedded code for the form",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "Unique form identifier",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_logo",
                        "in": "query",
                        "description": "Form logo (base64 encoded)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Forms Updated Successfully"
                                        },
                                        "forms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Forms Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Forms"
                ],
                "summary": "Delete a form",
                "operationId": "935e7acb22662229ac696db4ff098e56",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Form Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Forms Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/show_from_by_id/{id}": {
            "get": {
                "tags": [
                    "Forms"
                ],
                "summary": "Get a form by form_id (without authentication)",
                "operationId": "b698ce48605bce8016b84e6c0708fc0f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID (form_id field)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "string",
                                            "example": "No Forms Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-form/{id}": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Get form data by form_id (without authentication)",
                "operationId": "e5f7c49889050af837bbde980e077639",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID (form_id field)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "type": "string",
                                            "example": "No Forms Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-form-qrcode/{id}": {
            "get": {
                "tags": [
                    "Forms"
                ],
                "summary": "Generate QR code for a form",
                "operationId": "40f543ddc4c9d6e4229a08ed1949e22c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "QR code generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "forms": {
                                            "properties": {
                                                "qrcode": {
                                                    "description": "QR code image URL",
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-qr-code-pdf-download/{form_id}": {
            "get": {
                "tags": [
                    "Forms"
                ],
                "summary": "Download form QR code as PDF",
                "operationId": "6a5c2525a541630d7fcc798190d54510",
                "parameters": [
                    {
                        "name": "form_id",
                        "in": "path",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file download",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "404": {
                        "description": "Form not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forms/remove-logo": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Remove logo from a form",
                "operationId": "335af91de7690d1dfec24e2968d5b08a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Form ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Logo removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Form Logo Removed"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Form not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Form Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/forms/update-title": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Update the title of a form",
                "operationId": "formsUpdateTitle",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title"
                                ],
                                "properties": {
                                    "id": {
                                        "description": "Form ID. Not validated, but the update no-ops silently if omitted.",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "title": {
                                        "description": "New title",
                                        "type": "string",
                                        "example": "Contact us form"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Title updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign Title Saved Successfully"
                                        },
                                        "title": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/global-search": {
            "post": {
                "tags": [
                    "Search"
                ],
                "summary": "Search across leads, lead contacts, and lead companies",
                "operationId": "fdbfc7a3f9c79d3a77ee87c8fe158f55",
                "parameters": [
                    {
                        "name": "keyword",
                        "in": "query",
                        "description": "Search keyword",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "example search term"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "All Data"
                                        },
                                        "leads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/check-client": {
            "get": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Check if the user is authenticated with Gmail",
                "operationId": "c11965d0da9a7c87bf8fdc9bbb398d2e",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/list": {
            "get": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Get list of Gmail threads",
                "operationId": "e88aacf31332d5b2953ae695bf004ca8",
                "parameters": [
                    {
                        "name": "page_token",
                        "in": "query",
                        "description": "Token for pagination",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "threads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "next_page_token": {
                                            "type": "string"
                                        },
                                        "headers": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "List Gmail threads for the authenticated user (paginated)",
                "description": "Returns the next 10 Gmail threads. If the Gmail token is missing or expired, returns the OAuth auth link to reconnect.",
                "operationId": "024f5f2cb399251dfa44ac6dbfd7a90f",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "page_token": {
                                        "description": "Gmail nextPageToken for pagination",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Threads retrieved or auth link returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "threads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "next_page_token": {
                                            "type": "string"
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/{id}": {
            "get": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Get a specific Gmail thread by ID",
                "operationId": "bbf1010421e9d74e97d8d62f78771cfc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Thread ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Thread not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/send": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Send an email through Gmail",
                "operationId": "eea83aed488ffa77ba1a8db8bc6d8dc5",
                "parameters": [
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Recipient email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mail_body",
                        "in": "query",
                        "description": "Email body content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reply_to_message_id",
                        "in": "query",
                        "description": "ID of the message being replied to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "thread_id",
                        "in": "query",
                        "description": "Thread ID for the email",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email_signature",
                        "in": "query",
                        "description": "Email signature to append",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "append_signature",
                        "in": "query",
                        "description": "Whether to append signature",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/upload-attachment": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Upload an attachment for Gmail",
                "operationId": "c4b00ed4cb1a2f5c6e46b2bd0f737305",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "file_name": {
                                            "type": "string"
                                        },
                                        "file_path": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/download-attachment": {
            "get": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Download an attachment from a Gmail message",
                "operationId": "9f3d85f0bbcb85d06d4a4656befca288",
                "parameters": [
                    {
                        "name": "message_id",
                        "in": "query",
                        "description": "ID of the message containing the attachment",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachment_number",
                        "in": "query",
                        "description": "Number of the attachment to download",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File downloaded successfully",
                        "content": {
                            "application/octet-stream": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/leads-threads": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Get Gmail threads related to a specific lead",
                "operationId": "64fb72217e4d86a71be7c9ea7abd5f8e",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_token",
                        "in": "query",
                        "description": "Token for pagination",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "threads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "next_page_token": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/logout": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Logout from Gmail",
                "operationId": "0935752876cca0d62bde5a6e5cf65a12",
                "responses": {
                    "200": {
                        "description": "Successfully logged out",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/all_logout": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Logout from all Gmail accounts",
                "operationId": "35a982085f242d0813d191c18b1d5a64",
                "responses": {
                    "200": {
                        "description": "Successfully logged out from all accounts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/get-profile": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Get Gmail profile information",
                "operationId": "e2bd48358ea9fbf1a6dab5eb7e141df3",
                "responses": {
                    "200": {
                        "description": "Profile information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Profile information"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/pub-sub": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Handle Gmail push notifications",
                "operationId": "6bf0de96e868fe0c6faab38791534d1e",
                "responses": {
                    "200": {
                        "description": "Notification processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/add-watch-for-user": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Set up Gmail push notifications for users",
                "operationId": "5ad34a594032f6db6519309a5d766869",
                "responses": {
                    "200": {
                        "description": "Watch set up successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Watch is set up for user."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/gmail/send/{user_id}": {
            "post": {
                "tags": [
                    "Gmail"
                ],
                "summary": "Send a Gmail message on behalf of a specific user",
                "operationId": "94bcabf42d364bb8b50197356a2e987c",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "ID of the user whose Gmail account should send the message",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "to",
                                    "subject",
                                    "mail_body"
                                ],
                                "properties": {
                                    "to": {
                                        "description": "Recipient email or comma-separated list",
                                        "type": "string"
                                    },
                                    "subject": {
                                        "type": "string"
                                    },
                                    "mail_body": {
                                        "description": "HTML body",
                                        "type": "string"
                                    },
                                    "reply_to_message_id": {
                                        "description": "Gmail message ID being replied to",
                                        "type": "string"
                                    },
                                    "cc": {
                                        "type": "string"
                                    },
                                    "bcc": {
                                        "type": "string"
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Mail sent or auth link returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/auth-link": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get OAuth2 authorization link for Google Ads",
                "description": "Generates and returns the OAuth2 authorization URL for Google Ads API access.",
                "operationId": "getGoogleAdsAuthLink",
                "responses": {
                    "200": {
                        "description": "Authorization link generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "format": "url",
                                            "example": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent&client_id=your-client-id&redirect_uri=your-redirect-uri&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/all-auth-link": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get OAuth2 authorization link for all Gmail access",
                "description": "Generates and returns the OAuth2 authorization URL for all Gmail related Google APIs.",
                "operationId": "getAllGmailAuthLink",
                "responses": {
                    "200": {
                        "description": "Authorization link generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "auth_link": {
                                            "type": "string",
                                            "format": "url",
                                            "example": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent&client_id=your-client-id&redirect_uri=your-redirect-uri&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/auth-callback": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Handle Google Ads OAuth2 callback and exchange authorization code for tokens",
                "description": "Exchanges the `code` returned by Google for access/refresh tokens, decodes the id_token to capture the Gmail address, and persists a GoogleAdsToken row for the authenticated user.",
                "operationId": "googleAdsAuthCallback",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Google OAuth2",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "4/0AY0e-g7a123456789abcdef"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Auth token fetched and saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "authToken": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/all-auth-callback": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Handle OAuth2 callback for all Gmail accounts and exchange authorization code for tokens",
                "description": "Same flow as /auth-callback but uses the ALL_GMAIL_REDIRECT_URI redirect URI. Persists a GoogleAdsToken row for the authenticated user.",
                "operationId": "googleAdsAllAuthCallback",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Google OAuth2",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "4/0AY0e-g7a123456789abcdef"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Auth token fetched and saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "authToken": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/check-authenticated": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Check if user is authenticated with Google Ads",
                "operationId": "1ffe2237f43139e7cda876a1338949b1",
                "responses": {
                    "200": {
                        "description": "User is authenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "authenticated": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "authenticated": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/user-wise-accountlist": {
            "get": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get list of Gmail accounts connected by the authenticated user",
                "operationId": "493db1646be8d4a46019f03300717aec",
                "responses": {
                    "200": {
                        "description": "List of connected Gmail accounts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "emailList": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "gmail_email_address": {
                                                        "type": "string",
                                                        "example": "user@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/logout": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Logout Gmail account linked to authenticated user",
                "operationId": "3d942b2f935bee2404b98aad09fc5756",
                "parameters": [
                    {
                        "name": "gmail_email_address",
                        "in": "query",
                        "description": "Gmail account to logout",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "user@example.com"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Logout success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been successfully logged out!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Email not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Email Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/action-select-customer": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get Google Ads account hierarchy",
                "description": "Retrieves the hierarchy of Google Ads accounts accessible to the given Gmail address. Invalid/expired tokens are returned in `invalidAccounts` rather than as an error.",
                "operationId": "selectCustomerHierarchy",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "gmail_email_address"
                                ],
                                "properties": {
                                    "gmail_email_address": {
                                        "description": "Gmail email address associated with the Google Ads account",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@gmail.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Hierarchy data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "hierarchiesFinal": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AccountHierarchyNode"
                                            }
                                        },
                                        "invalidAccounts": {
                                            "description": "Accounts whose tokens are revoked or expired",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "format": "email"
                                            }
                                        },
                                        "message": {
                                            "description": "Present only when the token has been revoked/expired",
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Unexpected error occurred while retrieving hierarchy"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/campaigns-report": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get campaigns report grouped by filter type and campaign",
                "description": "Runs a GAQL query against the user's connected Google Ads account and returns per-campaign metrics plus rolled-up totals.",
                "operationId": "googleAdsCampaignsReport",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "manager_id",
                                    "customer_id",
                                    "filter_type",
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "Gmail address linked to the Google Ads access token",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "manager_id": {
                                        "description": "Google Ads manager (login customer) ID",
                                        "type": "string",
                                        "example": "1234567890"
                                    },
                                    "customer_id": {
                                        "description": "Google Ads customer ID to fetch report for",
                                        "type": "string",
                                        "example": "9876543210"
                                    },
                                    "filter_type": {
                                        "description": "Segment filter type passed into the GAQL query (e.g., date, week, month)",
                                        "type": "string",
                                        "example": "date"
                                    },
                                    "start_date": {
                                        "description": "Start date for report (YYYY-MM-DD)",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-01"
                                    },
                                    "end_date": {
                                        "description": "End date for report (YYYY-MM-DD)",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-31"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Datatables campaigns report with totals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "currency_code": {
                                                        "type": "string"
                                                    },
                                                    "impressions": {
                                                        "type": "integer"
                                                    },
                                                    "clicks": {
                                                        "type": "integer"
                                                    },
                                                    "ctr": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "average_cpc": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "cost_micros": {
                                                        "type": "integer"
                                                    },
                                                    "conversions": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "view_through_conversions": {
                                                        "type": "integer"
                                                    },
                                                    "cost_per_conversion": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "interactions": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "viewThroughConversionsTotal": {
                                            "type": "integer"
                                        },
                                        "costTotal": {
                                            "type": "string"
                                        },
                                        "clicksTotal": {
                                            "type": "integer"
                                        },
                                        "averageCpcTotal": {
                                            "type": "string"
                                        },
                                        "conversionsTotal": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "conversionRateTotal": {
                                            "type": "string"
                                        },
                                        "costPerConversionTotal": {
                                            "type": "string"
                                        },
                                        "impressionsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Email Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Something went wrong",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/view-campaigns-reports": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Get campaign report rows segmented by filter and date range",
                "description": "Same dataset as /campaigns-report but adds a `segments.<filter_type>` column so callers can chart over time.",
                "operationId": "googleAdsViewCampaignsReport",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "manager_id",
                                    "customer_id",
                                    "filter_type",
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "Gmail address linked to the Google Ads access token",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "manager_id": {
                                        "description": "Google Ads manager (login customer) ID",
                                        "type": "string",
                                        "example": "1234567890"
                                    },
                                    "customer_id": {
                                        "description": "Google Ads customer ID",
                                        "type": "string",
                                        "example": "9876543210"
                                    },
                                    "filter_type": {
                                        "description": "Segment filter type (e.g., date, week, month)",
                                        "type": "string",
                                        "example": "date"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-31"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "404": {
                        "description": "Email Not Found"
                    },
                    "500": {
                        "description": "Server Error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/search-keywords": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Fetch keyword performance data from Google Ads",
                "description": "Returns keyword statistics with filtering and pagination.",
                "operationId": "eb69d5902c9235cfece3277e46ca490f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "filter": {
                                        "description": "Filter type (e.g., campaign, adgroup)",
                                        "type": "string",
                                        "example": "campaign"
                                    },
                                    "filter_id": {
                                        "description": "ID corresponding to the filter",
                                        "type": "integer",
                                        "example": 123456
                                    },
                                    "start_date": {
                                        "description": "Start date for the data range",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-01-01"
                                    },
                                    "end_date": {
                                        "description": "End date for the data range",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2025-01-31"
                                    },
                                    "page": {
                                        "description": "Page number for pagination",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "per_page": {
                                        "description": "Number of records per page",
                                        "type": "integer",
                                        "example": 10
                                    },
                                    "search": {
                                        "description": "Search term to filter keywords",
                                        "type": "string",
                                        "example": "keyword text"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful response with keyword data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "keywordId": {
                                                        "type": "string"
                                                    },
                                                    "keywordText": {
                                                        "type": "string"
                                                    },
                                                    "clicks": {
                                                        "type": "integer"
                                                    },
                                                    "impressions": {
                                                        "type": "integer"
                                                    },
                                                    "ctr": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "averageCpc": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "cost": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "conversions": {
                                                        "type": "integer"
                                                    },
                                                    "costPerConversion": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "qualityScore": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "draw": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameters"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/view-search-keywords": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "View search keywords data from Google Ads",
                "description": "Returns keyword-level metrics segmented by `filter_type` for the given date range.",
                "operationId": "googleAdsViewSearchKeywords",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "manager_id",
                                    "customer_id",
                                    "filter_type",
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "Gmail address linked to the Google Ads access token",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "manager_id": {
                                        "description": "Google Ads manager (login customer) ID",
                                        "type": "string",
                                        "example": "1234567890"
                                    },
                                    "customer_id": {
                                        "description": "Google Ads customer ID",
                                        "type": "string",
                                        "example": "9876543210"
                                    },
                                    "filter_type": {
                                        "description": "Segment filter type (e.g., date, week, month)",
                                        "type": "string",
                                        "example": "date"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-31"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Keyword metrics retrieved successfully"
                    },
                    "404": {
                        "description": "Email not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/search-terms": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Fetch search terms report from Google Ads",
                "description": "Returns aggregated search-term performance for the given customer and date range.",
                "operationId": "googleAdsSearchTerms",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "manager_id",
                                    "customer_id",
                                    "filter_type",
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "Gmail address linked to the Google Ads access token",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "manager_id": {
                                        "description": "Google Ads manager (login customer) ID",
                                        "type": "string",
                                        "example": "1234567890"
                                    },
                                    "customer_id": {
                                        "description": "Google Ads customer ID",
                                        "type": "string",
                                        "example": "9876543210"
                                    },
                                    "filter_type": {
                                        "description": "Segment filter type (e.g., date, week, month)",
                                        "type": "string",
                                        "example": "date"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-31"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Search term report retrieved successfully"
                    },
                    "404": {
                        "description": "Email not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/website-report/view-search-terms": {
            "post": {
                "tags": [
                    "Google Ads"
                ],
                "summary": "Retrieve search term performance report from Google Ads",
                "description": "Same dataset as /search-terms but segmented by the requested filter so the UI can chart performance over time.",
                "operationId": "googleAdsViewSearchTerms",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "manager_id",
                                    "customer_id",
                                    "filter_type",
                                    "start_date",
                                    "end_date"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "Gmail address linked to the Google Ads access token",
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "manager_id": {
                                        "description": "Google Ads manager (login customer) ID",
                                        "type": "string",
                                        "example": "1234567890"
                                    },
                                    "customer_id": {
                                        "description": "Google Ads customer ID",
                                        "type": "string",
                                        "example": "9876543210"
                                    },
                                    "filter_type": {
                                        "description": "Segment filter type (e.g., date, week, month)",
                                        "type": "string",
                                        "example": "date"
                                    },
                                    "start_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2024-01-31"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Search terms data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "newArray": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "searchTermWise": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Email not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/authentication": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Check if user is authenticated with Google Analytics or return the authentication URL",
                "operationId": "cc5c2be5ccd3e03758e4d75476e60df0",
                "responses": {
                    "200": {
                        "description": "Success response with either profile ID or auth URL",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_login": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile_id": {
                                            "type": "string",
                                            "example": "12345678",
                                            "nullable": true
                                        },
                                        "authUrl": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?client_id=...",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-web-analytics4/authentication": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Check if user is authenticated with Google Analytics (All Gmail Flow) or return the authentication URL",
                "operationId": "5e67a55701f372e101c23f5ab4ea13ab",
                "responses": {
                    "200": {
                        "description": "Successful response with profile ID if logged in, or authentication URL if not",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "is_login": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile_id": {
                                            "type": "string",
                                            "example": "UA-12345678-1",
                                            "nullable": true
                                        },
                                        "authUrl": {
                                            "type": "string",
                                            "example": "https://accounts.google.com/o/oauth2/auth?client_id=...",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/token": {
            "post": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Fetch Google Analytics tokens using authorization code",
                "operationId": "85a0ce128d5ebefdb1a22b4309d782cb",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Google OAuth",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "4/0AX4XfW...AuthCode..."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tokens fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "access_token": {
                                            "type": "string",
                                            "example": "ya29.a0AfH6SM..."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or failed to fetch tokens",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid authorization code"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-web-analytics4/token": {
            "post": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Fetch Google Analytics tokens using authorization code for all Gmail accounts",
                "operationId": "c220783d2754d20fc9f4734d8bf6360f",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Google OAuth",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "4/0AX4XfW...AuthCode..."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tokens fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile_id": {
                                            "type": "string",
                                            "example": "123456789"
                                        },
                                        "is_login": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation error or failed to fetch tokens",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Invalid authorization code"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/accounts": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get Google Analytics account properties for authenticated user",
                "operationId": "0c55117ec7086b0785b37baac0042074",
                "responses": {
                    "200": {
                        "description": "List of Google Analytics account properties",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "properties": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "name": {
                                                        "type": "string",
                                                        "example": "My Website Property"
                                                    },
                                                    "property_id": {
                                                        "type": "string",
                                                        "example": "123456789"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error fetching analytics accounts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Some error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/properti-data/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get Google Analytics property data for the authenticated user",
                "operationId": "dfa2a9af9d87c690d15f66efccbf11d1",
                "parameters": [
                    {
                        "name": "property_id",
                        "in": "path",
                        "description": "Google Analytics property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the data in YYYY-MM-DD format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the data in YYYY-MM-DD format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Analytics property data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "properti_date": {
                                            "description": "Property data returned by getUsers method",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error retrieving property data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/age-wise-audience/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get user age bracket analytics data for a GA property",
                "description": "Returns age bracket analytics data for the specified Google Analytics property within a date range.",
                "operationId": "getUserAgeBracket",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with age bracket data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "ageBracket": {
                                                        "type": "string",
                                                        "example": "25-34"
                                                    },
                                                    "userCount": {
                                                        "type": "integer",
                                                        "example": 100
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/country-wise-users/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get country-wise user counts for a GA property",
                "description": "Returns total users grouped by country for the specified Google Analytics property within a date range.",
                "operationId": "getCountryWiseUsers",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with country-wise user data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "country": {
                                                        "type": "string",
                                                        "example": "United States"
                                                    },
                                                    "totalUsers": {
                                                        "type": "integer",
                                                        "example": 1500
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/day-wise-users/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get day-wise user counts for a GA property",
                "description": "Returns user counts grouped by day for the specified Google Analytics property within a date range.",
                "operationId": "getDayWiseUsers",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with day-wise user data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "date": {
                                                        "type": "string",
                                                        "example": "2023-01-01"
                                                    },
                                                    "userCount": {
                                                        "type": "integer",
                                                        "example": 100
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "usercount": {
                                            "type": "integer",
                                            "example": 5000
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/day-wise-page-views/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get day-wise page views for a GA property",
                "description": "Returns page views grouped by day for the specified Google Analytics property within a date range.",
                "operationId": "getDayWisePageViews",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with day-wise page views data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "date": {
                                                        "type": "string",
                                                        "example": "2023-01-01"
                                                    },
                                                    "pageViews": {
                                                        "type": "integer",
                                                        "example": 150
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "usercount": {
                                            "type": "integer",
                                            "example": 5000
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/top-exit-pages/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get top exit pages by active users",
                "description": "Returns the top 10 exit pages for the specified Google Analytics property based on active users within a date range.",
                "operationId": "getTopExitPages",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with top exit pages data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "exitPage": {
                                                        "type": "string",
                                                        "example": "/contact"
                                                    },
                                                    "activeUsers": {
                                                        "type": "integer",
                                                        "example": 1200
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/top-landing-pages/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get top landing pages by active users",
                "description": "Returns the top 10 landing pages for the specified Google Analytics property based on active users within a date range.",
                "operationId": "getTopLandingPages",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for analytics data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with top landing pages data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "landingPage": {
                                                        "type": "string",
                                                        "example": "/home"
                                                    },
                                                    "activeUsers": {
                                                        "type": "integer",
                                                        "example": 1500
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input parameters"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/conversions/{properti_id}": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Get conversion metrics for a property",
                "description": "Retrieve conversion-related metrics for the specified Google Analytics property within a date range.",
                "operationId": "getConversions",
                "parameters": [
                    {
                        "name": "properti_id",
                        "in": "path",
                        "description": "Google Analytics Property ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date for the data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date for the data (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversion metrics response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "properti_date": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "conversions": {
                                                        "type": "integer",
                                                        "example": 150
                                                    },
                                                    "engagedSessions": {
                                                        "type": "integer",
                                                        "example": 300
                                                    },
                                                    "purchaserConversionRate": {
                                                        "type": "number",
                                                        "format": "float",
                                                        "example": 0.25
                                                    },
                                                    "sessionConversionRate": {
                                                        "type": "number",
                                                        "format": "float",
                                                        "example": 0.15
                                                    },
                                                    "userConversionRate": {
                                                        "type": "number",
                                                        "format": "float",
                                                        "example": 0.2
                                                    },
                                                    "engagementRate": {
                                                        "type": "number",
                                                        "format": "float",
                                                        "example": 0.75
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid parameters"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/web-analytics4/logout": {
            "get": {
                "tags": [
                    "Google Analytics"
                ],
                "summary": "Logout user and delete their WebAnalytics data",
                "description": "Deletes the authenticated user's WebAnalytics record to logout.",
                "operationId": "googleAnalytics4Logout",
                "responses": {
                    "200": {
                        "description": "Logout successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Logout Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Logout failed or user data not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/grapesjs/save": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Save website content",
                "operationId": "5c847f297b1568e961e14e5f06f4a583",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "query",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Website content as JSON array",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "pages",
                        "in": "query",
                        "description": "Website pages as JSON array",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "html",
                        "in": "query",
                        "description": "HTML content",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "description": "CSS content",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Update website content",
                "operationId": "cb6e10edbcfadacc00d918fa0e19b921",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "query",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Website content as JSON array",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "pages",
                        "in": "query",
                        "description": "Website pages as JSON array",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "html",
                        "in": "query",
                        "description": "HTML content",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "css",
                        "in": "query",
                        "description": "CSS content",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/create-website-using-template-id/{id}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Create a new website using a template",
                "operationId": "6bab3f076a2200bf7d91a2ea12afc2e8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Template not found"
                    },
                    "403": {
                        "description": "Not enough credits"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/grapesjs/load/{id}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Load website content by ID",
                "operationId": "d15ed6d1699e965bdbb92b019a0b0514",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website content loaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "content": {
                                            "type": "object"
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "pages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "assets": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "frames": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found"
                    }
                }
            }
        },
        "/api/grapesjs/upload": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Upload a file for the website",
                "operationId": "e87a627fcd6e9693339f8df6b6f7339b",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload (jpg, jpeg, png, gif, max 10MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "url": {
                                            "type": "string",
                                            "example": "https://s3.amazonaws.com/bucket/uploads/file.jpg"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/grapesjs/delete-s3-file": {
            "delete": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Delete files from S3",
                "operationId": "24285624e7679cbeef1b13c38a5efc0e",
                "parameters": [
                    {
                        "name": "srcs",
                        "in": "query",
                        "description": "Array of file URLs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "url"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Files deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Assets deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/grapesjs/get-by-uuid/{uuid}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Get website content by UUID",
                "operationId": "eed4e13ca93dec633bc2d6b426df24eb",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website content retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "content": {
                                            "type": "object"
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "description": {
                                            "type": "string"
                                        },
                                        "html": {
                                            "type": "string"
                                        },
                                        "css": {
                                            "type": "string"
                                        },
                                        "hosted_zone_id": {
                                            "type": "string"
                                        },
                                        "name_servers": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found"
                    }
                }
            }
        },
        "/api/website-list/datatable": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Get list of websites for datatable",
                "operationId": "3cb1640550d0b51055d3b1dd4242308a",
                "responses": {
                    "200": {
                        "description": "List of websites retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-forms-by-uuid/{uuid}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Get forms by website UUID",
                "operationId": "94a2737884d6ccd81618fe9049c5a536",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Forms retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "label": {
                                                "type": "string"
                                            },
                                            "url": {
                                                "type": "string"
                                            },
                                            "form_id": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found or no forms available"
                    }
                }
            }
        },
        "/api/publish-website/{uuid}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Publish website to S3",
                "operationId": "ed5ec20271f678b488987248fb71c9de",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website published successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "uuid": {
                                            "type": "string"
                                        },
                                        "url": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found"
                    },
                    "500": {
                        "description": "Failed to upload to S3"
                    }
                }
            }
        },
        "/api/generate-ai-image": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Generate an AI image for the website",
                "operationId": "9e472def400fa708fafe4df994869eeb",
                "parameters": [
                    {
                        "name": "prompt",
                        "in": "query",
                        "description": "Text prompt for image generation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "uuid",
                        "in": "query",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Image generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "url": {
                                            "type": "string"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not enough credits or website not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Error generating image"
                    }
                }
            }
        },
        "/api/generate-ai-content": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Generate AI content for the website",
                "operationId": "9fca1e1f2831b5706e406005113860ad",
                "parameters": [
                    {
                        "name": "prompt",
                        "in": "query",
                        "description": "Text prompt for content generation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "uuid",
                        "in": "query",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Content generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "content": {
                                            "type": "string"
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not enough credits or website not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Error generating content"
                    }
                }
            }
        },
        "/api/website-delete/{id}": {
            "delete": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Delete a website",
                "operationId": "a0ee68292843c6c8908edec1cbd5e9f5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the website to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Website deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found"
                    },
                    "500": {
                        "description": "Error deleting website"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/publish-website-pages/{uuid}": {
            "get": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Upload HTML pages to S3",
                "operationId": "4a6abfe037846023d3848880fc9a4722",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "UUID of the website",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pages uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "pages": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Website not found"
                    },
                    "400": {
                        "description": "No pages found"
                    },
                    "500": {
                        "description": "Error uploading pages"
                    }
                }
            }
        },
        "/api/help-articles": {
            "get": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Get a list of help articles",
                "operationId": "300ec555d7cc9fde544ad185df2da3ee",
                "responses": {
                    "200": {
                        "description": "List of help articles retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                }
            },
            "post": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Create a new help article",
                "operationId": "c1bb05724363721057bc99ac61d2c770",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the help article",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the help article",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content_type_id",
                        "in": "query",
                        "description": "Content type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Help article created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Help article created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/help-articles/{id}": {
            "get": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Get a specific help article by ID",
                "operationId": "a13547457cfb03fedaa1226b05345291",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the help article",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Help article retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Help article not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Update a specific help article",
                "operationId": "da19552806d87a6fdd7c9bf5530095bc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the help article to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the help article",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the help article",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content_type_id",
                        "in": "query",
                        "description": "Content type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Help article updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Help article updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Help article not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Delete a specific help article",
                "operationId": "8ecb9c9a1e3cc19361fa87c8707d1bb9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the help article to delete",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Help article deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Help article deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Help article not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-help-article": {
            "get": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Get help articles with filtering and pagination",
                "operationId": "b4d84990c773684f91994f93630fc7e4",
                "parameters": [
                    {
                        "name": "searchKeyword",
                        "in": "query",
                        "description": "Search keyword to filter articles by title or description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "contentType",
                        "in": "query",
                        "description": "Content type IDs to filter articles (comma-separated)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sortBy",
                        "in": "query",
                        "description": "Sort by field (Name or Date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "Date",
                            "enum": [
                                "Name",
                                "Date"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Help articles retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "page": {
                                            "type": "integer"
                                        },
                                        "limit": {
                                            "type": "integer"
                                        },
                                        "total_record": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No help articles found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                }
            }
        },
        "/api/get-content-type": {
            "get": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Get all content types",
                "operationId": "7eb389ae5c9cbf23e8eda355c17199db",
                "responses": {
                    "200": {
                        "description": "Content types retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No content types found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                }
            }
        },
        "/api/help-articles/slug/{slug}": {
            "get": {
                "tags": [
                    "Help Articles"
                ],
                "summary": "Get a help article by its SEO slug (public)",
                "description": "Unauthenticated. Same payload as GET /api/help-articles/{id}, looked up by help_articles.seo_slug instead of id.",
                "operationId": "78a89cbebaf981a03238ee649b9d99f8",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "The article's SEO slug",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "getting-started-with-leads"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The article with its content type",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "description": "help_articles row plus content_type_title and content_type_slug",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "No help article found for the slug",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Help Article Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/instagram/check-client": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Check if user has a valid Instagram token",
                "operationId": "5824cfcc072920eb388e1c7dfe516e22",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "user_id": {
                                                    "type": "string"
                                                },
                                                "username": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/instagram/check-client-conversation": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Check if user has a valid Instagram token for conversations",
                "operationId": "05eb1bd42d238d0a2e0e44e0175c3572",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "user_id": {
                                                    "type": "string"
                                                },
                                                "username": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-instagram-client": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Create a user account with Instagram",
                "operationId": "c7fd8a8f5911739f58a9539033357373",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Instagram OAuth",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "user_id": {
                                                    "type": "string"
                                                },
                                                "username": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-instagram-conversation-client": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Create a user account with Instagram for conversations",
                "operationId": "828995c296ea17eefebbff58fc82d64e",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Instagram OAuth",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "user_id": {
                                                    "type": "string"
                                                },
                                                "username": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/instagram/get-client-conversation/{id}": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Get user's Instagram conversations",
                "operationId": "eaebb91254b30a2b9e8fac5228b4752c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-instagram-account/{id}": {
            "post": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Disconnect a user's Instagram account",
                "operationId": "8d70dc11c4e417abda3c4021fb3f4d7c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "auth_url": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-instagram-message-list": {
            "post": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Get messages from a specific Instagram conversation",
                "operationId": "329f5c950805a8fe1a668776c46d6519",
                "parameters": [
                    {
                        "name": "conversation_id",
                        "in": "query",
                        "description": "Conversation ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "ig_user_id": {
                                            "type": "string"
                                        },
                                        "instagram_user_id": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-instagram-message": {
            "post": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Send a message to an Instagram user",
                "operationId": "c3e6ad78bda2d85bacb02582cca3ce9f",
                "parameters": [
                    {
                        "name": "recipientId",
                        "in": "query",
                        "description": "Recipient ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Message text",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "iguser",
                        "in": "query",
                        "description": "Instagram user ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-instagram-webhook-event": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Instagram webhook receiver (incoming message notifications)",
                "description": "Receives Meta/Instagram webhook events and posts an in-app notification to the user owning the recipient Instagram account. Note: route is GET but the handler reads the raw POST body via `file_get_contents('php://input')`.",
                "operationId": "instagramWebhookResponse",
                "responses": {
                    "200": {
                        "description": "Event processed (or silently ignored when no matching InstagramToken row exists)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Handle Instagram webhook responses",
                "operationId": "563574d7bf4a3ad940c9c9e562d6e60a",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": []
            }
        },
        "/api/instagram/get-client-conversation-by-sender-id/{id}": {
            "get": {
                "tags": [
                    "Instagram"
                ],
                "summary": "Get the Instagram conversation behind a new-message notification",
                "description": "Despite the route name, {id} is a NOTIFICATION id (a new_instagram_message notification), not a sender id — the sender is read from the notification's stored webhook payload. Using the authenticated user's Instagram token, the matching conversation is fetched from the Instagram Graph API and its messages are returned oldest-first, grouped by date. When the notification does not exist or the user has no unexpired Instagram token, the response is 200 with an empty body.",
                "operationId": "768cfdf7291e1d0f64cc7fd8d8c246ad",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Notification ID of the new_instagram_message notification",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Messages grouped by calendar date (empty body when the notification or a valid token is missing)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "description": "Map of \"Y-m-d\" date => list of Graph API message objects (id, created_time, from, to, message, attachments)",
                                            "type": "object",
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "ig_user_id": {
                                            "description": "The connected account's user_id from the Graph API",
                                            "type": "string"
                                        },
                                        "instagram_user_id": {
                                            "description": "instagram_user_id stored on the user's Instagram token",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Graph API or processing error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-instagram-reply-list": {
            "post": {
                "tags": [
                    "Instagram"
                ],
                "summary": "DataTables list of the user's Instagram message notifications",
                "description": "Lists new_instagram_message notifications addressed to the authenticated user, newest first, each joined with its lead and lead contact when the notification carries a lead record_id. The stored webhook payload is returned decoded in the properties field.",
                "operationId": "390bbbec791b11b0e92a11b0bfbc78a0",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Standard DataTables request parameters (draw, start, length, search, order)",
                                "properties": {
                                    "draw": {
                                        "type": "integer",
                                        "example": 1,
                                        "nullable": true
                                    },
                                    "start": {
                                        "type": "integer",
                                        "example": 0,
                                        "nullable": true
                                    },
                                    "length": {
                                        "type": "integer",
                                        "example": 10,
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "DataTables page of notifications",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "record_id": {
                                                        "description": "Lead id the notification is attached to, when known",
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "properties": {
                                                        "description": "Decoded Instagram webhook payload",
                                                        "type": "object"
                                                    },
                                                    "event": {
                                                        "type": "string",
                                                        "example": "new_instagram_message"
                                                    },
                                                    "is_email_replied": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "is_primary_contact": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "phone_number": {
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get all invoices",
                "operationId": "0be1c22f1f233d1d9c1e4d36e312de33",
                "responses": {
                    "200": {
                        "description": "List of all invoices",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "invoice": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Create a new invoice",
                "operationId": "f85a2b18aba5a3c7c2a6d5924dc7a6ee",
                "parameters": [
                    {
                        "name": "bill_date",
                        "in": "query",
                        "description": "Bill date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (Y-m-d), must be after or equal to bill_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-15"
                        }
                    },
                    {
                        "name": "invoice_reference",
                        "in": "query",
                        "description": "Invoice reference (must be unique)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bill_to",
                        "in": "query",
                        "description": "Lead ID to bill to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Added successfully."
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice/data-table/get": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get invoices data for datatable",
                "operationId": "13aeec4539090351ff9a9d8103f8594a",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering results",
                        "required": false,
                        "schema": {
                            "properties": {
                                "value": {
                                    "type": "string"
                                },
                                "regex": {
                                    "type": "boolean"
                                }
                            },
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoices data for datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice/{id}": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get invoice details by ID",
                "operationId": "63cf0115720ee6c990e0c99ff925570e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "invoice": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Update an existing invoice",
                "operationId": "b674aa711f0dfa26661481ebb9644507",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "bill_date",
                        "in": "query",
                        "description": "Bill date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (Y-m-d), must be after or equal to bill_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-15"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Invoice status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "sent",
                                "paid",
                                "unpaid",
                                "cancelled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Delete an invoice",
                "operationId": "b5c25d4e5c91e4295e550b32a5344c7d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invoice Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice/view-reports": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get invoice reports with filtering options",
                "operationId": "7f6c18bb7f059e9d3b7544328260eda3",
                "parameters": [
                    {
                        "name": "selectedClient",
                        "in": "query",
                        "description": "Filter by client ID (use 'all' for all clients)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice reports data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice/duplicate/{id}": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Duplicate an existing invoice",
                "operationId": "f242f397740ebd16a95cdc7470b13502",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice to duplicate",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice duplicated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Duplicated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice/items/{invoice_id}": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get all items for a specific invoice",
                "operationId": "8e8de4994554678de36503f8205763fb",
                "parameters": [
                    {
                        "name": "invoice_id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice items data with custom fields",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "bill_summary": {
                                            "type": "object"
                                        },
                                        "invoice_payments": {
                                            "type": "object"
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    },
                                                    "custom_fields": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "title": {
                                                                    "type": "string"
                                                                },
                                                                "field_type": {
                                                                    "type": "string"
                                                                },
                                                                "value": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-invoice-data/{id}": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "Get invoice data for a specific lead",
                "operationId": "f555faf78e9e4900c020d70e47a7845a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead invoice data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "custom_fields": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-item": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Get a list of invoice items",
                "operationId": "718363a5a4b08268d4bafa2b6d19fdfd",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "allitem": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Store a newly created invoice item",
                "operationId": "dd7f15f81f3572aa9f6b96c8564eb4b2",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of the item (optional)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice item created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Item Added Successfully"
                                        },
                                        "invoice_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-item/create": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Show form for creating a new invoice item",
                "operationId": "9a6596b863f957ff7a0d65b816d47cd1",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-item/{id}": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Display the specified invoice item",
                "operationId": "d66bec692b9ea62fab3e86b6600666ac",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "bill_summary": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice item not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Update the specified invoice item",
                "operationId": "3f47fc0c9b23caf1c891163c0684f5bd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "quantity",
                        "in": "query",
                        "description": "Quantity of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "total",
                        "in": "query",
                        "description": "Total amount (optional)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice item updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Item Updated Successfully"
                                        },
                                        "invoice": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Invoice item not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Remove the specified invoice item",
                "operationId": "dc77f5bae74d31a97a0e96f19e0ff1a7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice item deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Item Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice item not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-single-tasks/{id}": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Get a single invoice item for editing",
                "operationId": "180186258bb2fdb627f2760552727064",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 2666
                                                },
                                                "title": {
                                                    "type": "string",
                                                    "example": "Task Title"
                                                },
                                                "description": {
                                                    "type": "string",
                                                    "example": "Task description"
                                                },
                                                "rate": {
                                                    "type": "string",
                                                    "example": "100.00"
                                                },
                                                "qty": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total": {
                                                    "type": "string",
                                                    "example": "100.00"
                                                },
                                                "estimate_id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "item_id": {
                                                    "type": "integer",
                                                    "example": 456
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "datetime"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "datetime"
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Priority"
                                                            },
                                                            "value": {
                                                                "type": "string",
                                                                "example": "High"
                                                            },
                                                            "field_type": {
                                                                "type": "string",
                                                                "example": "select",
                                                                "enum": [
                                                                    "text",
                                                                    "textarea",
                                                                    "select",
                                                                    "checkbox",
                                                                    "radio",
                                                                    "date",
                                                                    "file"
                                                                ]
                                                            },
                                                            "file_name": {
                                                                "description": "Only present for file type fields",
                                                                "type": "string",
                                                                "example": "document"
                                                            },
                                                            "ext": {
                                                                "description": "Only present for file type fields",
                                                                "type": "string",
                                                                "example": "pdf"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice item not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-item/{id}/edit": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Show form for editing the specified invoice item",
                "operationId": "7b60dc76cc6a6abbdc241077a175cc90",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice item not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-pdf/{id}": {
            "get": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Generate PDF for the specified invoice",
                "operationId": "905750626a2ce6bafbf262ce49ecfb71",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file downloaded successfully"
                    },
                    "404": {
                        "description": "Invoice not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-mail/{id}": {
            "put": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Send invoice by email",
                "operationId": "dfc7938026ed0e9164573eeb65609e63",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Email address to send to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "description": "CC email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bcc",
                        "in": "query",
                        "description": "BCC email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "recurring",
                        "in": "query",
                        "description": "Whether the invoice is recurring",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "recurring_period",
                        "in": "query",
                        "description": "Recurring period (day, week, month, quarter, half_year, year)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "day",
                                "week",
                                "month",
                                "quarter",
                                "half_year",
                                "year"
                            ]
                        }
                    },
                    {
                        "name": "final_total",
                        "in": "query",
                        "description": "Final total amount",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice sent Successfully."
                                        },
                                        "invoice": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-payment-reminder/{id}": {
            "put": {
                "tags": [
                    "Invoice Items"
                ],
                "summary": "Send a payment reminder email for an unpaid invoice",
                "description": "Only allowed for not_paid / part-payment invoices whose invoice email was already sent. The outstanding amount is computed server-side (never from the client payload); when the client has a connected Stripe account and a balance is due, a fresh one-off Stripe payment link for exactly that balance is created and embedded in the email (a Stripe failure is logged and the email still goes out, just without the link). The invoice PDF is attached; sending updates last_email_sent_date and logs a payment_reminder_sent activity.",
                "operationId": "a69588456ecf4de667f1fbc32a525e2c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "to",
                                    "subject"
                                ],
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "subject": {
                                        "type": "string"
                                    },
                                    "cc": {
                                        "type": "string",
                                        "format": "email",
                                        "nullable": true
                                    },
                                    "bcc": {
                                        "type": "string",
                                        "format": "email",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Reminder sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Payment reminder sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, invoice is not unpaid, or the invoice email was never sent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found for this client"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-payment": {
            "get": {
                "tags": [
                    "Invoice Payments"
                ],
                "summary": "Get all invoice payments",
                "operationId": "2ee68a03e105d9571564ec720575562a",
                "responses": {
                    "200": {
                        "description": "List of all invoice payments",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "invoice-payments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Invoice Payments"
                ],
                "summary": "Store a new invoice payment",
                "operationId": "3e558b616442601c80a1f904101efb04",
                "parameters": [
                    {
                        "name": "amount",
                        "in": "query",
                        "description": "Payment amount",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "100.50"
                        }
                    },
                    {
                        "name": "payment_date",
                        "in": "query",
                        "description": "Date of payment (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-15"
                        }
                    },
                    {
                        "name": "payment_method_id",
                        "in": "query",
                        "description": "ID of the payment method",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    },
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice payment created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Payment Added successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/invoice-payment/{id}": {
            "get": {
                "tags": [
                    "Invoice Payments"
                ],
                "summary": "Get payments for a specific invoice",
                "operationId": "bd48a6c3681cfc9d2200486038a1c225",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice payments retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "payment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice payment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Payment Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Invoice Payments"
                ],
                "summary": "Update a specific invoice payment",
                "operationId": "4af49b643b8a021fb5fc512a34c5d0f3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice Payment ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    },
                    {
                        "name": "amount",
                        "in": "query",
                        "description": "Payment amount",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "example": "100.50"
                        }
                    },
                    {
                        "name": "payment_date",
                        "in": "query",
                        "description": "Date of payment (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-15"
                        }
                    },
                    {
                        "name": "payment_method_id",
                        "in": "query",
                        "description": "ID of the payment method",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    },
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "ID of the invoice",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice payment updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Payment Updated Successfully."
                                        },
                                        "invoice": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice payment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invoice Payment Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Invoice Payments"
                ],
                "summary": "Delete a specific invoice payment",
                "operationId": "27e84f2d673c5b037984305e8fe5b658",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice Payment ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice payment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Payment Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice payment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Invoice Payment Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/item": {
            "get": {
                "tags": [
                    "Items"
                ],
                "summary": "Get all items",
                "operationId": "a1842f0c0e576759824f4ba4903f38fc",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Items"
                ],
                "summary": "Create a new item",
                "operationId": "24784c124b865d2a60a6e9a0aabc3428",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Item title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Item description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Item rate",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Item created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Item Added Successfully"
                                        },
                                        "item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/item/data-table/get": {
            "post": {
                "tags": [
                    "Items"
                ],
                "summary": "Get items for data table",
                "operationId": "0ec44cb0207f60c394afc8ff85debdf8",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/item/{id}": {
            "get": {
                "tags": [
                    "Items"
                ],
                "summary": "Get a specific item",
                "operationId": "32d968b7b66b42ca7107dc8adfef83fe",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Item ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Items"
                ],
                "summary": "Update an existing item",
                "operationId": "cbb0b882fe5afddf89a991505444dedb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Item ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Item title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Item description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Item rate",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Item updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Item Updated Successfully."
                                        },
                                        "item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Items"
                ],
                "summary": "Delete an item",
                "operationId": "15316c467de6bdf63f54a14107154ec2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Item ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Item deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Item Deleted Successfully."
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "type": "string",
                                            "example": "Item Not Found"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/item/{id}/custom-field/{customFieldId}": {
            "delete": {
                "tags": [
                    "Items"
                ],
                "summary": "Delete custom field value for an item",
                "operationId": "b3db3c827efd4d1e787954c3a99ad82e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Item ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "customFieldId",
                        "in": "path",
                        "description": "Custom Field ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field value deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Custom field value deleted successfully"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Item or custom field not found"
                    },
                    "500": {
                        "description": "Error deleting custom field value"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-action-plan": {
            "get": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Get a list of lead action plans",
                "operationId": "21f1fdb690e773cee9ad2a4eea8e7037",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Store a new lead action plan",
                "operationId": "df14a0b3c9a8dc6cc0d2d97995dd50f6",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "description": "Action data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "json"
                        }
                    },
                    {
                        "name": "wait_till",
                        "in": "query",
                        "description": "Date and time to wait until",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "email_address",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "mobile",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action plan created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead action plan created successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/multiple-lead-action-apply": {
            "post": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Apply multiple lead actions",
                "operationId": "70e9d380bd5f605a92b8f6e5e7197553",
                "parameters": [
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "Array of lead IDs",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "description": "Action data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "json"
                        }
                    },
                    {
                        "name": "wait_till",
                        "in": "query",
                        "description": "Date and time to wait until",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Multiple lead actions applied successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Multiple lead actions applied successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-action-plan/{id}": {
            "get": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Get a specific lead action plan",
                "operationId": "33c3b06c33dc854205fb196571fb6d7d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead action plan",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action plan retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead action plan not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Update a specific lead action plan",
                "operationId": "a82ceedf79bf1c5adb4cd0b403baff00",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead action plan",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "action",
                        "in": "query",
                        "description": "Action data in JSON format",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "json"
                        }
                    },
                    {
                        "name": "wait_till",
                        "in": "query",
                        "description": "Date and time to wait until",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action plan updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead action plan updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead action plan not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Delete a specific lead action plan",
                "operationId": "a9445f92e45a31f88180ea74f2607f98",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead action plan",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action plan deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead action plan deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead action plan not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-action-plan": {
            "post": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Get lead action plans based on criteria",
                "operationId": "e88dd3f3fb6e0644f84392ac653c296e",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action plans retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No lead action plans found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-lead-action": {
            "post": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Delete lead actions by ID",
                "operationId": "cdb797cf7445a97c6b16d8aa69be04fe",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead actions deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead actions deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No lead actions found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-single-lead-action": {
            "post": {
                "tags": [
                    "Lead Action Plans"
                ],
                "summary": "Delete a single lead action by ID",
                "operationId": "8c74e3477cc0b5e1d59d1c52b549cc14",
                "parameters": [
                    {
                        "name": "lead_action_id",
                        "in": "query",
                        "description": "ID of the lead action",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead action deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead action deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead action not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-list": {
            "post": {
                "tags": [
                    "Lead App"
                ],
                "summary": "Get list of leads with pagination and filtering",
                "operationId": "519d078a550b96fa1fe183ad462d5f33",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "ID of the lead position to filter by",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "keyword",
                        "in": "query",
                        "description": "Search keyword to filter leads by name or email",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "john"
                        }
                    },
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "Array of filter conditions",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "filter_name": {
                                        "type": "string",
                                        "example": "lead_contacts.first_name"
                                    },
                                    "filter_selected": {
                                        "type": "string",
                                        "example": "contains"
                                    },
                                    "contains": {
                                        "type": "string",
                                        "example": "John"
                                    },
                                    "filter_type": {
                                        "type": "string",
                                        "example": "text"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "myColumns": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "lead_position_id": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-appointment/get": {
            "post": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Get all lead appointments",
                "operationId": "30ff4fa73febb6b3f0733efe14834fac",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-appointment/{id}": {
            "get": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Get lead appointments for a specific lead",
                "operationId": "3d07e8cc43f968c12ea503ecee9ed937",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "cat_id",
                        "in": "query",
                        "description": "Category ID to filter appointments",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_appointment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "lead": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead appointment not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Update lead appointments for a specific lead",
                "operationId": "3d58ae7ebd1cca60efffa30df9259a80",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_appointment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead appointment not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-appointment": {
            "get": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Display a listing of lead appointments",
                "operationId": "ac978bd25f4adba0d1c01c563cca6d78",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Store a newly created lead appointment",
                "operationId": "1aafccea362ea750aebea0e9158e4a4a",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-appointment/{lead_appointment}": {
            "delete": {
                "tags": [
                    "Lead Appointments"
                ],
                "summary": "Remove the specified lead appointment",
                "operationId": "7f9fa4bcbc7a9faa7e2e1f4eb16927ed",
                "parameters": [
                    {
                        "name": "lead_appointment",
                        "in": "path",
                        "description": "ID of the lead appointment to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead appointment deleted successfully"
                    },
                    "404": {
                        "description": "Lead appointment not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-company": {
            "get": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Get all lead companies for a specific lead position",
                "operationId": "11ec39d35bc8ba07c845f34511a61b8d",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead Position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_company_details": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Create a new lead company",
                "operationId": "c2917c4ea15869d5715bba90ff93c6cb",
                "parameters": [
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_website",
                        "in": "query",
                        "description": "Company website",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead company created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Added Successfully"
                                        },
                                        "lead_company": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-company/{id}": {
            "get": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Get a specific lead company by ID",
                "operationId": "b8abdd24dcd86760804fb961e47901ca",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Company ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_company": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Company not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Update a specific lead company",
                "operationId": "767db2d06e4874cb7e09f771ceb77c6a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Company ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_website",
                        "in": "query",
                        "description": "Company website",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead company updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Updated Successfully."
                                        },
                                        "lead_company": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Company not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Delete a specific lead company",
                "operationId": "d34e099abc04da07cf225149a649fafd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Company ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead company deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Company not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-company-update/{id}": {
            "post": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Update a lead company with additional functionality",
                "description": "Update a lead company with additional functionality for registered clients.",
                "operationId": "35cfa7207d89113ad8b5f33f52ba44d0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Company ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "company_website",
                        "in": "query",
                        "description": "Company website",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead company updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Updated Successfully."
                                        },
                                        "lead_company": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Company not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Company Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-lead-company": {
            "post": {
                "tags": [
                    "Lead Company"
                ],
                "summary": "Get all companies for a specific lead",
                "description": "Get all companies for a specific lead.",
                "operationId": "557c05a10da73c72dca94eca8680e0fc",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "companies": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contact": {
            "get": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Get all lead contacts for a specific lead position",
                "operationId": "d1facdf664faadf4a765e2736df55e4a",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead Position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_contact_details": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Create a new lead contact",
                "operationId": "3f49221df9fb799f2c39b729f27da9ed",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_company_id",
                        "in": "query",
                        "description": "Lead Company ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "known_as",
                        "in": "query",
                        "description": "Known as",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "job_title",
                        "in": "query",
                        "description": "Job title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "contact_type_id",
                        "in": "query",
                        "description": "Contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_spouse",
                        "in": "query",
                        "description": "Is spouse contact (0 or 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contact created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Added Successfully"
                                        },
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contact/{id}": {
            "get": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Get a specific lead contact by ID",
                "operationId": "ab4864bd1e4eb9623138979b83d2285c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Contact ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Contact not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Update a specific lead contact",
                "operationId": "1633b811c687e517f7a5cca1098822c1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Contact ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_company_id",
                        "in": "query",
                        "description": "Lead Company ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Updated Successfully."
                                        },
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Contact not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Delete a specific lead contact",
                "operationId": "dc96289cbcbc9cc34e5e66331ed0c851",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Contact ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contact deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Contact not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contact-update/{id}": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Update a lead contact with additional functionality",
                "description": "Update a lead contact with additional functionality.",
                "operationId": "bac39665833f235d0b99fc9e40cdfff7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Contact ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_company_id",
                        "in": "query",
                        "description": "Lead Company ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "known_as",
                        "in": "query",
                        "description": "Known as",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "job_title",
                        "in": "query",
                        "description": "Job title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "contact_type_id",
                        "in": "query",
                        "description": "Contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_spouse",
                        "in": "query",
                        "description": "Is spouse contact (0 or 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Updated Successfully."
                                        },
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Contact not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Contact Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-action-contact": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Create a new action contact with optional spouse contact",
                "description": "Create a new action contact with optional spouse contact.",
                "operationId": "0b49c04ad5a073b9ac1e8632dd769f96",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "male",
                                "female",
                                "other"
                            ]
                        }
                    },
                    {
                        "name": "contact_type_id",
                        "in": "query",
                        "description": "Contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "birth_date",
                        "in": "query",
                        "description": "Birth date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "street_address",
                        "in": "query",
                        "description": "Street address",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street_address2",
                        "in": "query",
                        "description": "Street address line 2",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Country",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "postcode",
                        "in": "query",
                        "description": "Postal code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_spouse",
                        "in": "query",
                        "description": "Whether to add spouse contact (1 for yes, 0 for no)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "spouse_first_name",
                        "in": "query",
                        "description": "Spouse first name (required if is_spouse=1)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "spouse_last_name",
                        "in": "query",
                        "description": "Spouse last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "spouse_email",
                        "in": "query",
                        "description": "Spouse email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "spouse_mobile_number",
                        "in": "query",
                        "description": "Spouse mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "spouse_gender",
                        "in": "query",
                        "description": "Spouse gender",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "male",
                                "female",
                                "other"
                            ]
                        }
                    },
                    {
                        "name": "spouse_contact_type_id",
                        "in": "query",
                        "description": "Spouse contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact has been added successfully"
                                        },
                                        "lead": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-action-contact": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Update an existing action contact",
                "description": "Update an existing action contact.",
                "operationId": "04d77f5d26ac33f86944d0a32d269c22",
                "parameters": [
                    {
                        "name": "contact_id",
                        "in": "query",
                        "description": "Contact ID to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "male",
                                "female",
                                "other"
                            ]
                        }
                    },
                    {
                        "name": "contact_type_id",
                        "in": "query",
                        "description": "Contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "birth_date",
                        "in": "query",
                        "description": "Birth date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "street_address",
                        "in": "query",
                        "description": "Street address",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street_address2",
                        "in": "query",
                        "description": "Street address line 2",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Country",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "postcode",
                        "in": "query",
                        "description": "Postal code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact has been updated successfully"
                                        },
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-next-contact-date": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Add next contact date for multiple lead contacts",
                "description": "Add next contact date for multiple lead contacts.",
                "operationId": "50898c23cf7f85e7a41ad9fde62df166",
                "parameters": [
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "JSON array of lead IDs",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "next_contact_date_time",
                        "in": "query",
                        "description": "Next contact date and time",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "spouse_contact",
                        "in": "query",
                        "description": "Include spouse contact",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Reminder date added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Reminder Date added successfully."
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-lead-contact-field": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Update a specific field of a lead contact",
                "description": "Update a specific field of a lead contact.",
                "operationId": "0bdb431ff6caf25cfbfc0ca0268cef1f",
                "parameters": [
                    {
                        "name": "lead_contact_id",
                        "in": "query",
                        "description": "Lead contact ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_name",
                        "in": "query",
                        "description": "Field name to update (first_name, mobile_number, email, street_address, city, state, postcode)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "first_name",
                                "mobile_number",
                                "email",
                                "street_address",
                                "city",
                                "state",
                                "postcode"
                            ]
                        }
                    },
                    {
                        "name": "field_value",
                        "in": "query",
                        "description": "New value for the field",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Data updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data updated successfully."
                                        },
                                        "lead_contact": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-lead-contact": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Get all contacts for a specific lead",
                "description": "Get all contacts for a specific lead.",
                "operationId": "9e2561a025eb156dd2804f69b055e1ca",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contacts": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contacts/email-verification-datatable": {
            "post": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Get email verification data for datatable",
                "description": "Get email verification data for datatable.",
                "operationId": "1704f8507a78157da7b08aae5f3cd70c",
                "parameters": [
                    {
                        "name": "draw",
                        "in": "query",
                        "description": "Draw counter for datatable",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Start index for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search[value]",
                        "in": "query",
                        "description": "Search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order[0][column]",
                        "in": "query",
                        "description": "Column index for sorting",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order[0][dir]",
                        "in": "query",
                        "description": "Sort direction (asc or desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "custom_filter",
                        "in": "query",
                        "description": "Custom filters",
                        "required": false,
                        "schema": {
                            "properties": {
                                "lead_position": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "string"
                                },
                                "created_date": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contact-resubscribe/{leadContact}": {
            "get": {
                "tags": [
                    "Lead Contact"
                ],
                "summary": "Re-subscribe a lead contact (public link)",
                "description": "Sets `unsubscribed=0` on the LeadContact, marks all campaign emails for that contact as no-longer-unsubscribed, and redirects to the Angular feedback page. Designed to be opened from a marketing email's re-subscribe link.",
                "operationId": "leadContactResubscribe",
                "parameters": [
                    {
                        "name": "leadContact",
                        "in": "path",
                        "description": "LeadContact ID (route model bound)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1234
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to Angular `unsubscribe-resubscribe-feedback` page with query flags",
                        "headers": {
                            "Location": {
                                "description": "Target URL on the Angular frontend",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "LeadContact not found"
                    }
                }
            }
        },
        "/api/lead-custom-field-value": {
            "get": {
                "tags": [
                    "Lead Custom Field Value"
                ],
                "summary": "Get all lead custom field values",
                "operationId": "86e7383c403348e3ec65c605c3505ba1",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_custom_field_value": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "field_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "field_value": {
                                                        "type": "string",
                                                        "example": "Value"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Custom Field Value"
                ],
                "summary": "Create a new lead custom field value",
                "operationId": "b5e23bdac9a6ff9cd138b14182fb8ee8",
                "parameters": [
                    {
                        "name": "field_id",
                        "in": "query",
                        "description": "Field ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "field_value",
                        "in": "query",
                        "description": "Field value",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead Custom Field added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Custom Field Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-custom-field-value/{id}": {
            "get": {
                "tags": [
                    "Lead Custom Field Value"
                ],
                "summary": "Get a specific lead custom field value by ID",
                "operationId": "f455d82c7a3abc4158c6a6f492b56f3b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Custom Field Value ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_custom_field_value": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "field_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "field_value": {
                                                    "type": "string",
                                                    "example": "Value"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Custom Field Value not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_custom_field_value": {
                                            "type": "string",
                                            "example": "No Lead Custom Field Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Custom Field Value"
                ],
                "summary": "Update a specific lead custom field value",
                "operationId": "fd095b8bf717fe8fac2a40bb0992a91c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Custom Field Value ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_id",
                        "in": "query",
                        "description": "Field ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "field_value",
                        "in": "query",
                        "description": "Field value",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead Custom Field updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Custom Field Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Custom Field Value not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Lead Custom Field Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Custom Field Value"
                ],
                "summary": "Delete a specific lead custom field value",
                "operationId": "5bb384be8f2f102c93f9b9d817e6c9fb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead Custom Field Value ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead Custom Field deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Custom Field Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead Custom Field Value not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Custom Field Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get all leads for the authenticated user's client",
                "operationId": "9249241ac30271d4969f91e1ca5a917b",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "lead_id": {
                                                "type": "integer"
                                            },
                                            "first_name": {
                                                "type": "string"
                                            },
                                            "last_name": {
                                                "type": "string"
                                            },
                                            "email": {
                                                "type": "string"
                                            },
                                            "company_name": {
                                                "type": "string"
                                            },
                                            "custom_fields": {
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Create a new lead",
                "operationId": "a81b0fe58940c7d6637c6336c834a305",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead Position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_title",
                        "in": "query",
                        "description": "Lead title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Lead domain",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the lead to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_source",
                        "in": "query",
                        "description": "Lead source",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Custom fields array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Lead companies array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Lead contacts array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Added Successfully."
                                        },
                                        "position_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/data-table/get": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead data in tabular format with filtering and sorting",
                "operationId": "73b9eb9835dc36537b28419cfa158673",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Filter leads by position ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "Filter leads by form ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Order direction (asc/desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "orderBy",
                        "in": "query",
                        "description": "Column to order by",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/lead-export": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Export leads data",
                "operationId": "10173b1034defe8e3c45828e626a1ae9",
                "parameters": [
                    {
                        "name": "filters",
                        "in": "query",
                        "description": "Filters for lead export",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Export initiated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Added Successfully."
                                        },
                                        "position_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-zapier-lead": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Add a lead via Zapier integration",
                "operationId": "d56bbb114a3108f03eafc943fa77e3c6",
                "parameters": [
                    {
                        "name": "hubspot_username",
                        "in": "query",
                        "description": "Email of the Hubspot user to associate the lead with",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "hubspot@example.com"
                        }
                    },
                    {
                        "name": "annual_revenue",
                        "in": "query",
                        "description": "Annual revenue",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "example": 500000
                        }
                    },
                    {
                        "name": "lead_title",
                        "in": "query",
                        "description": "Title of the lead",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "CEO of XYZ Inc"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Lead domain",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Primary contact email",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "contact@example.com"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "John"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Doe"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Male"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "company_email",
                        "in": "query",
                        "description": "Company email",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "company@example.com"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Example Corp"
                        }
                    },
                    {
                        "name": "locality",
                        "in": "query",
                        "description": "Locality",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Downtown"
                        }
                    },
                    {
                        "name": "number_of_employees",
                        "in": "query",
                        "description": "Number of employees",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 50
                        }
                    },
                    {
                        "name": "postcode",
                        "in": "query",
                        "description": "Postcode",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "90210"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "California"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Los Angeles"
                        }
                    },
                    {
                        "name": "street_address",
                        "in": "query",
                        "description": "Street address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "123 Main St"
                        }
                    },
                    {
                        "name": "street_address2",
                        "in": "query",
                        "description": "Secondary address line",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Suite 400"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Added Successfully."
                                        },
                                        "Lead": {
                                            "description": "Created lead object",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get a specific lead by ID",
                "operationId": "2fd93fcf59429afda439777d873d8e0c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead": {
                                            "type": "object"
                                        },
                                        "previous_lead_id": {
                                            "type": "integer"
                                        },
                                        "next_lead_id": {
                                            "type": "integer"
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        },
                                        "projects": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "client_id": {
                                                        "type": "integer"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "nullable": true
                                                    },
                                                    "deadline": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update an existing lead",
                "operationId": "1bc931c6a88de01b3fac4517d35a6feb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_title",
                        "in": "query",
                        "description": "Title of the lead",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Lead domain",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID of the lead",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the lead to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_client",
                        "in": "query",
                        "description": "Whether the lead is a client (1) or not (0)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Array of lead contact information",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Array of lead company information",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Array of custom field values",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete a lead",
                "operationId": "73241791b19097003b5a511507a5ae33",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-specific-lead": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead details without authentication",
                "operationId": "5e66c0db961b1373022668a154b43611",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the lead to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "lead_title": {
                                            "type": "string"
                                        },
                                        "domain": {
                                            "type": "string"
                                        },
                                        "leadContacts": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "leadCompanies": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "custom_fields": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/update/{id}": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update a lead with specific fields",
                "operationId": "149c84b5f7f0d55b2b9251b619eb4406",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_title",
                        "in": "query",
                        "description": "Title of the lead",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Lead domain",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "example.com"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID of the lead",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the lead to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_client",
                        "in": "query",
                        "description": "Whether the lead is a client (1) or not (0)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Array of lead contact information",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Array of lead company information",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "custom_fields",
                        "in": "query",
                        "description": "Array of custom field values",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-search": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Search leads and export results to CSV",
                "operationId": "e32d4fb8c0bf132d031926f96e9e021a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to search for",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "CSV file download",
                        "content": {
                            "application/octet-stream": {}
                        }
                    },
                    "422": {
                        "description": "Lead IDs not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Ids Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads-bulk-delete": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete multiple leads at once",
                "operationId": "53fb2c6cf16c81c927c1c77b68415b27",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to delete, or ['all'] to delete all leads for a position",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads-bulk-edit": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update multiple leads at once",
                "operationId": "9ad79b0d21cd56e0b31aac2d5a657686",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to update",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Company name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the leads to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Leads Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads-bulk-lead-position-id": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update lead position ID for multiple leads",
                "operationId": "02039b573472f61e04b05600490a276b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to update",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "New lead position ID to assign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/multi-leads-assigned-to": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Assign multiple leads to a user",
                "description": "Updates the assigned_to field for multiple leads and adds notifications",
                "operationId": "cd07b3b9b866bfd16b035e4581772986",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the leads to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to be assigned",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads assigned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Leads Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or leads not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads-assigned-to": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Assign a lead to a user",
                "operationId": "ee4c327dbc3aea4cb51ac3342f0af6b2",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the lead to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID to assign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "all_transfer",
                        "in": "query",
                        "description": "Flag to transfer all leads from user_id to assigned_to",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to transfer leads from (required if all_transfer is true)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead assigned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contact Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Contact Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/multi-leads-delete": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete multiple leads at once",
                "operationId": "735ec63e1a94df98b4917532f1c075f6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Leads Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/remove-duplicate-leads": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Remove duplicate leads based on email",
                "operationId": "89398ad612fbdd8af8fbacfffa678505",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email to search for duplicates",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_position",
                        "in": "query",
                        "description": "Lead position to filter by, or 'all' for all positions",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remove_lead",
                        "in": "query",
                        "description": "Which leads to remove: 'old' or 'new'",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "old",
                                "new"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate leads removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Duplicate Leads Removed Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or no duplicates found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Duplicate Leads Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/file-import": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Import leads from a CSV file",
                "operationId": "ba99dde958f2fd25083a640173be189b",
                "parameters": [
                    {
                        "name": "import_file",
                        "in": "query",
                        "description": "CSV file to import (max 12.5MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID for the imported leads",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "file_header": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "file_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        "custom_fields": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "column_list": {
                                            "type": "object"
                                        },
                                        "newLeadsCount": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No file provided"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/file-import-contact": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Import lead contacts from a CSV file",
                "operationId": "74b4029e2f0a8cdb275276768035d021",
                "parameters": [
                    {
                        "name": "import_file",
                        "in": "query",
                        "description": "CSV file to import (max 12.5MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID for the imported lead contacts",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "file_header": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "file_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        "custom_fields": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "column_list": {
                                            "type": "object"
                                        },
                                        "newLeadsCount": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No file provided"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads-import": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Process and import leads from prepared data",
                "operationId": "1e7165b490877a89ca596a38f19fe4c6",
                "parameters": [
                    {
                        "name": "file_data",
                        "in": "query",
                        "description": "CSV file data processed from previous step",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    {
                        "name": "import_data",
                        "in": "query",
                        "description": "Import configuration data",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID for the imported leads",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "custom_fields_data",
                        "in": "query",
                        "description": "Custom fields mapping data",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leads Imported Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Import failed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "All the records are duplicates."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something Went Wrong"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-notes/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get notes associated with a lead",
                "operationId": "30566d779c20a672c2555db4b145d2e9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get notes for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead notes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_notes": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "lead_id": {
                                                        "type": "integer"
                                                    },
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "note": {
                                                        "type": "string"
                                                    },
                                                    "important": {
                                                        "type": "integer"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "first_name": {
                                                        "type": "string"
                                                    },
                                                    "last_name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead notes not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Notes Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/set-note-as-important": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Set a lead note as important or not important",
                "operationId": "2d1c1f31f6300e023976be1558af10eb",
                "parameters": [
                    {
                        "name": "note_id",
                        "in": "query",
                        "description": "ID of the note to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead the note belongs to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "important",
                        "in": "query",
                        "description": "Flag to mark the note as important (1) or not important (0)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Note updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-tasks/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get tasks associated with a lead",
                "operationId": "52c4966c108e409f925f68618d07ca0e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get tasks for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_tasks": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "lead_id": {
                                                        "type": "integer"
                                                    },
                                                    "task_title": {
                                                        "type": "string"
                                                    },
                                                    "task_description": {
                                                        "type": "string"
                                                    },
                                                    "due_date_time": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "remainder_time": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "assigned_to": {
                                                        "type": "integer"
                                                    },
                                                    "assigned_user_data": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "first_name": {
                                                                "type": "string"
                                                            },
                                                            "last_name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "smsPhoneNumberCount": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead tasks not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Tasks Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-files/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get files associated with a lead",
                "operationId": "6681fe48b6ea36184c412edc046cc934",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get files for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead files retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_files": {
                                            "oneOf": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "lead_id": {
                                                                "type": "integer"
                                                            },
                                                            "file": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "updated_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                {
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead files not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_files": {
                                            "type": "string",
                                            "example": "Lead Files Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-quotes/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get quotes associated with a lead",
                "operationId": "69cfbed0464e89ec263ec8df97d7b0ca",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get quotes for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead quotes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_quotes": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "lead_id": {
                                                        "type": "integer"
                                                    },
                                                    "quote_title": {
                                                        "type": "string"
                                                    },
                                                    "quote_description": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead quotes not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Quotes Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/company-list": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get list of companies for the authenticated user's client",
                "operationId": "6a82854b76cae6411a1729ce457a099a",
                "responses": {
                    "200": {
                        "description": "Companies retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "company_id": {
                                                        "type": "integer"
                                                    },
                                                    "company_name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/activities/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get activities for a specific lead",
                "operationId": "86bfaede0c708cec09f284f3d06aecb4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get activities for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Activities retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "activities": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-board/{id}": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update lead board information",
                "operationId": "37e0fb3c3d30c9f3165b256ef4840c2b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_position_stage_id",
                        "in": "query",
                        "description": "Position stage ID for the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_position_stage_set_id",
                        "in": "query",
                        "description": "Position stage set ID for the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead board updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadBoard Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage/order-change": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Change the order of lead position stages",
                "operationId": "6e2f6689654f7efb05695ab9cd212dd5",
                "parameters": [
                    {
                        "name": "order_change",
                        "in": "query",
                        "description": "Array of position stage IDs in the desired order",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stages sorted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Sorted Successfully"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage/get-list-sort-wise": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get sorted list of lead position stages",
                "operationId": "a0699170c7e032def8d672b74c30baca",
                "responses": {
                    "200": {
                        "description": "Lead position stages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "lead_position_stage_set_id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            },
                                            "sort": {
                                                "type": "integer"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage/get-list-sort-wise-use-id/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get sorted list of lead position stages for a specific position ID",
                "operationId": "5417bcf641b0ccbde19dfd105adeadf5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Position ID to get stages for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "lead_position_stage_set_id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            },
                                            "sort": {
                                                "type": "integer"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-wise-getdata": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead data filtered by position",
                "operationId": "42ddb8438125af0052aceec59b75a11b",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID to filter leads by",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_position_stage_id",
                        "in": "query",
                        "description": "Position stage ID to filter leads by",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term to filter leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-email-new-details": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead email details for autocomplete or specific lead",
                "operationId": "e61d72ea3771caf233ef4aaeb4f8b208",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Search query for lead autocomplete",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of a specific lead to retrieve",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead email details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "mobile_number": {
                                                "type": "string"
                                            },
                                            "email": {
                                                "type": "string"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-email-details": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get email details for all leads",
                "operationId": "b756f727059e0c6eaf5a9fd46ed0ae92",
                "responses": {
                    "200": {
                        "description": "Lead email details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leads": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "lead_id": {
                                                        "type": "integer"
                                                    },
                                                    "first_name": {
                                                        "type": "string"
                                                    },
                                                    "last_name": {
                                                        "type": "string"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "company_name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-lead-counts": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get total count of leads",
                "operationId": "ec3568582832c25036a6e9d32175b8d7",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering leads (format: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering leads (format: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leads_count": {
                                            "type": "integer",
                                            "example": 150
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/stage-wise-lead-count": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead count grouped by stages",
                "operationId": "b3f9d736df3f2ad90971805cfef047d9",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID to filter leads by",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to filter leads by (use 'unassigned' for unassigned leads)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stage-wise lead count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "stage_wise_lead_count": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "lead_position_stage_id": {
                                                        "type": "integer"
                                                    },
                                                    "lead_count": {
                                                        "type": "integer"
                                                    },
                                                    "total": {
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "currency_symbol": {
                                            "type": "string",
                                            "example": "$"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/duplicate-leads/list": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get list of duplicate leads",
                "operationId": "cd34b2b8ff93af5c99cfeca0eecf5252",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Position ID to filter leads by (use 'all' for all positions)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate leads retrieved successfully in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-save-in-lead": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Save form data as a lead",
                "description": "Processes form submission data and creates a new lead with contacts and companies",
                "operationId": "0b7c4f055f8cea6a65a918b39337cefb",
                "parameters": [
                    {
                        "name": "g-recaptcha-response",
                        "in": "query",
                        "description": "Google reCAPTCHA response token",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "ID of the form being submitted",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_details",
                        "in": "query",
                        "description": "Details of the user submitting the form",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "value",
                        "in": "query",
                        "description": "Form field values including file uploads",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "leads",
                        "in": "query",
                        "description": "Lead data",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Contact information for the lead",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Company information for the lead",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form submitted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead": {
                                            "type": "object"
                                        },
                                        "campaign_id": {
                                            "type": "integer"
                                        },
                                        "lead_email": {
                                            "type": "string"
                                        },
                                        "forms": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "after_form_submit": {
                                            "type": "string"
                                        },
                                        "redirect_url": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid request. Please try after sometime."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-save-or-update-in-lead": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Save form data as a lead. If any lead found with same email address it will update existing lead.",
                "description": "Processes form submission data and creates a new lead with contacts and companies",
                "operationId": "71bd5e23f894da905329e9aac55267ae",
                "parameters": [
                    {
                        "name": "g-recaptcha-response",
                        "in": "query",
                        "description": "Google reCAPTCHA response token",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "ID of the form being submitted",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_details",
                        "in": "query",
                        "description": "Details of the user submitting the form",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "value",
                        "in": "query",
                        "description": "Form field values including file uploads",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "leads",
                        "in": "query",
                        "description": "Lead data",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Contact information for the lead",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Company information for the lead",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form submitted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead": {
                                            "type": "object"
                                        },
                                        "campaign_id": {
                                            "type": "integer"
                                        },
                                        "lead_email": {
                                            "type": "string"
                                        },
                                        "forms": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "after_form_submit": {
                                            "type": "string"
                                        },
                                        "redirect_url": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid request. Please try after sometime."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/paid-user-for-lightup": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update lead position and user type for a lightup user",
                "operationId": "09ecae342ddda15f921c917834b24a78",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address of the lead",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID to update to",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 4547
                        }
                    },
                    {
                        "name": "user_type",
                        "in": "query",
                        "description": "Type of user",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "paid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead and custom field updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-client-list": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get list of clients from leads for the authenticated user's client",
                "operationId": "0cd43abf27f03eb4e1f090a70525314e",
                "responses": {
                    "200": {
                        "description": "Client list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "client_list": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "lead_id": {
                                                        "type": "integer"
                                                    },
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "lead_company_id": {
                                                        "type": "integer"
                                                    },
                                                    "is_primary_contact": {
                                                        "type": "integer"
                                                    },
                                                    "first_name": {
                                                        "type": "string"
                                                    },
                                                    "last_name": {
                                                        "type": "string"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "company_name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Client list not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Client List Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/check-email-exist-or-not": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Check if an email already exists in the system",
                "operationId": "6cdb02e1a32cf541ee04a625faea42ec",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to check",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID to exclude from the check",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1234
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email check completed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "is_email": {
                                            "description": "True if email exists, false otherwise",
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-deal-view": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update deal view preference",
                "description": "Updates or creates a user's view preference for a specific lead position",
                "operationId": "192fa0c3dfd2ba0894e9e00081bb6d6e",
                "parameters": [
                    {
                        "name": "user_d",
                        "in": "query",
                        "description": "User identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "view",
                        "in": "query",
                        "description": "View preference",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "View preference updated successfully"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check_phone_no": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Validate a phone number using Twilio",
                "operationId": "d0932135df1f581323c5b6aee87c57ab",
                "parameters": [
                    {
                        "name": "phone_no",
                        "in": "query",
                        "description": "Phone number to validate",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead associated with the phone number",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number validated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Number is valid..!"
                                        },
                                        "phone_no": {
                                            "type": "string",
                                            "example": "+14155552671"
                                        },
                                        "lead_contact": {
                                            "properties": {
                                                "first_name": {
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "type": "string"
                                                },
                                                "lead_contact_id": {
                                                    "type": "integer"
                                                },
                                                "contact_name": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "assignPhoneNumberCount": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid phone number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Number is not valid. Please update your number with your country code."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-response-email-on-form-submit": {
            "post": {
                "tags": [
                    "Forms"
                ],
                "summary": "Send response email after form submission",
                "description": "Sends a campaign email to the lead after form submission",
                "operationId": "8f8c169b69308bf94140e1b48400ca15",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the campaign to send",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to_email",
                        "in": "query",
                        "description": "Email address to send to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_contact_id",
                        "in": "query",
                        "description": "ID of the lead contact",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign mail has been sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Campaign not approved or not set",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Campaign mail is not approved yet"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/fetch-login-details-by-lead-id/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get login details for a specific lead",
                "operationId": "bb48161e6f8d7e7e9661aef5b0258cb8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get login details for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Login details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "last_login": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Login details not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "last_login": {
                                            "type": "string",
                                            "example": "login date not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/view-reports": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get form-wise lead reports",
                "operationId": "600b67b82a9b05a30f69dc2983d43023",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering leads (format: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-01-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering leads (format: Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form-wise lead reports retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/save-field-grid-of-leads": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Save field grid configuration for leads",
                "operationId": "2856a8bd1d1427004c9933bc117ca815",
                "parameters": [
                    {
                        "name": "fields",
                        "in": "query",
                        "description": "JSON configuration of fields grid",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Field grid saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "stored_data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-field-grid-of-leads/{user_id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get field grid configuration for leads by user ID",
                "operationId": "51c4198f343629d793f0b9546d9781b4",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "ID of the user to get field grid configuration for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Field grid configuration retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "field_grid_of_leads": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Field grid configuration not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "field_grid_of_leads": {
                                            "type": "string",
                                            "example": "fields grid not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead/upload-attachment": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Upload an attachment file",
                "operationId": "35340aa25deda4032c61674a3c51c1a7",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload (max size: 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File has been uploaded successfully"
                                        },
                                        "path": {
                                            "type": "string",
                                            "example": "http://example.com/storage/custom-fields-files/filename.pdf"
                                        },
                                        "file_name": {
                                            "type": "string",
                                            "example": "filename.pdf"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/missed_incoming_call/{id}": {
            "get": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get count of missed incoming calls",
                "operationId": "8e03baa57e3fe86ca1c4e9ae4141e2c1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID to get missed call count for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Missed call count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "missed_incoming_call_count": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-missed-incoming-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get list of missed incoming calls and mark them as viewed",
                "operationId": "5739388fab3a3f7a3a7ef93464ade954",
                "responses": {
                    "200": {
                        "description": "Missed call list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "missedCallList": {
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "from": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "lead_id": {
                                                                "type": "integer"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "draw": {
                                                    "type": "integer"
                                                },
                                                "recordsFiltered": {
                                                    "type": "integer"
                                                },
                                                "recordsTotal": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-incoming-call": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Get list of all incoming calls",
                "operationId": "6cc6a5d7a38f68c0601f39f6cf73e602",
                "responses": {
                    "200": {
                        "description": "Incoming call list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "incomingCallList": {
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "from": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string",
                                                                "format": "date-time"
                                                            },
                                                            "call_status": {
                                                                "type": "string"
                                                            },
                                                            "call_duration": {
                                                                "type": "string"
                                                            },
                                                            "recording_url": {
                                                                "type": "string"
                                                            },
                                                            "in_recording_deleted": {
                                                                "type": "integer"
                                                            },
                                                            "notes": {
                                                                "type": "string"
                                                            },
                                                            "lead_id": {
                                                                "type": "integer"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "draw": {
                                                    "type": "integer"
                                                },
                                                "recordsFiltered": {
                                                    "type": "integer"
                                                },
                                                "recordsTotal": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "callCredit": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-lead-call-note": {
            "post": {
                "tags": [
                    "Lead Calls"
                ],
                "summary": "Add a note to a lead call log",
                "operationId": "a80660fd4c6d4b141feed961bffa7a94",
                "parameters": [
                    {
                        "name": "lead_call_id",
                        "in": "query",
                        "description": "ID of the lead call log to add a note to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Note text to add to the call log",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Note has been added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead call log not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Note not add"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-last-lead-id": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get the last lead ID viewed by the authenticated user",
                "operationId": "709f4e060116882e3a94e140328d1cfc",
                "responses": {
                    "200": {
                        "description": "Last lead ID retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lastLeadId": {
                                            "type": "integer",
                                            "example": 1234,
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/update-last-lead-id": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Update the last lead ID for the authenticated user",
                "operationId": "b2ddd5f09548b4d9064c06a36c7ff4d2",
                "parameters": [
                    {
                        "name": "lastLeadId",
                        "in": "query",
                        "description": "The lead ID to set as the last viewed lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Last lead ID updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "last_lead_id updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-first-lead-id": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get the first lead ID for the authenticated user's client",
                "operationId": "00dc6309302a9ed75977ed2e004ea687",
                "responses": {
                    "200": {
                        "description": "First lead ID retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "firstLeadId": {
                                            "type": "integer",
                                            "example": 1234,
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-contact-list": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get a list of lead contacts with filtering options",
                "operationId": "e82b312b22f91b7f7bf4b398faa9de1e",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "Filter by contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_start_date",
                        "in": "query",
                        "description": "Start date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_end_date",
                        "in": "query",
                        "description": "End date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "birth_start_date",
                        "in": "query",
                        "description": "Birth date filter (YYYY-MM-DD) - filters by month and day only",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contacts retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/lead-contact-delete-archiv": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get list of deleted or archived leads",
                "operationId": "7c8f82ab2d3dd32c1cf8c06f75408b06",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "Filter by contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_start_date",
                        "in": "query",
                        "description": "Start date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_end_date",
                        "in": "query",
                        "description": "End date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering contacts",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted or archived leads retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "contactData": {
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "draw": {
                                                    "type": "integer"
                                                },
                                                "recordsFiltered": {
                                                    "type": "integer"
                                                },
                                                "recordsTotal": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "searchVal": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/undo-deleted-archived-lead/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Restore a deleted or archived lead",
                "description": "Sets is_deleted and is_archived flags to 0 for a lead, effectively restoring it",
                "operationId": "02ebf6600a5edd5560b18ab205d57df2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to restore",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead restored successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact undo successfully!"
                                        },
                                        "lead": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-all-lead-ids": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get all lead IDs with filtering options",
                "operationId": "83c98d48872d10bd014cd11a53738940",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "Filter by contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead creation date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_start_date",
                        "in": "query",
                        "description": "Start date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_end_date",
                        "in": "query",
                        "description": "End date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "birth_start_date",
                        "in": "query",
                        "description": "Birth date filter (YYYY-MM-DD) - filters by month and day only",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "datatable_search_val",
                        "in": "query",
                        "description": "Search term for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead IDs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leadIds": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/contact-type-name": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get all contact types for the authenticated user's client",
                "operationId": "26eed684709903557e5e310f05d75f09",
                "responses": {
                    "200": {
                        "description": "Contact types retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/revenue-this-month": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get revenue statistics for the current month with comparison to previous month",
                "operationId": "b128a175dc214dadff48f07519b32fc8",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Custom start date for revenue calculation (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Custom end date for revenue calculation (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revenue statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "current_month_revenue": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "last_month_revenue": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "percentage_difference": {
                                            "type": "number",
                                            "format": "float"
                                        },
                                        "current_month_leads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "last_month_leads": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/revenue-reports": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get revenue reports for leads with filtering options",
                "operationId": "3b79e49949612b3501f44e63c5992ab6",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID, or 'all' for all users",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revenue reports retrieved successfully in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/revenue-statistics": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get revenue statistics grouped by lead source",
                "operationId": "48045bc90eca91b7aee330a82bcfdd66",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_source",
                        "in": "query",
                        "description": "Filter by lead source(s), can be a string or array",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revenue statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leadSource": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "leadAmount": {
                                            "type": "array",
                                            "items": {
                                                "type": "number"
                                            }
                                        },
                                        "leadCount": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/client-wise-leadsource": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead source statistics for the client",
                "operationId": "ead4a1949923d820662f2e1d66665186",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead position update date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead source statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leadSource": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "leadAmount": {
                                            "type": "array",
                                            "items": {
                                                "type": "number"
                                            }
                                        },
                                        "leadCount": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/conversion-ratio": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead conversion ratios by assigned user",
                "operationId": "0a9be4ad0116f85bc25ea23660b90251",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for lead assignment date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for lead assignment date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversion ratios retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "userLeadData": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "full_name": {
                                                        "type": "string"
                                                    },
                                                    "assigned_to": {
                                                        "type": "integer"
                                                    },
                                                    "assigned_total_lead": {
                                                        "type": "integer"
                                                    },
                                                    "converted_to_client": {
                                                        "type": "integer"
                                                    },
                                                    "percentage_converted": {
                                                        "type": "number",
                                                        "format": "float"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-archive/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Archive a lead",
                "operationId": "767b058d3fe8e5bf49c483f83a7277cc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID to archive",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead archived successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact archived successfully!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-delete/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Mark a lead as deleted",
                "operationId": "e83a6af9c7024f0cc9cab04012c030ec",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID to mark as deleted",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead marked as deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact deleted successfully!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-contact-reminders": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get contact reminders for the current day or specified date range",
                "operationId": "531c5015b4957f329efae45fe3419e8e",
                "parameters": [
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "Filter by contact type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "next_contact_start_date",
                        "in": "query",
                        "description": "Start date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_end_date",
                        "in": "query",
                        "description": "End date for next contact date range filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering contacts",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact reminders retrieved successfully in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/duplicates-datatable": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get a list of duplicate leads based on email",
                "operationId": "6d03830d9fe18e80e16fec70f29d4f23",
                "responses": {
                    "200": {
                        "description": "Duplicate leads retrieved successfully in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "lead_position_id": {
                                                        "type": "integer"
                                                    },
                                                    "total": {
                                                        "type": "integer"
                                                    },
                                                    "lead_ids": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/review-duplicates-datatable": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get detailed information about duplicate leads",
                "operationId": "072fc6a162be9406dd7beed742827871",
                "parameters": [
                    {
                        "name": "duplicate_data",
                        "in": "query",
                        "description": "Array of duplicate lead data to review. 'email' is required, 'at_lead_position' is optional (if omitted, returns duplicates from all positions)",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate lead details retrieved successfully in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/is-duplicate-emails-found": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Check if duplicate leads exist for given email addresses",
                "operationId": "00d3bf5c198929cc95f6eeb22fedc1ec",
                "parameters": [
                    {
                        "name": "emailIds",
                        "in": "query",
                        "description": "Array of email addresses to check for duplicates",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate check completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "is_duplicates_found": {
                                            "type": "boolean"
                                        },
                                        "duplicate_emails": {
                                            "type": "object",
                                            "example": {
                                                "chintan@telsamedia.com": true,
                                                "krutarth@telsamedia.com": false
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-duplicate-email-of-lead": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete leads or lead contacts associated with a duplicate email",
                "operationId": "b6d7d8c23d02820164f4c416df87cfd8",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to delete leads for",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID on which the duplicate email exists",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads deletion completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-multiple-duplicates": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete multiple duplicate leads in batch",
                "description": "Processes multiple sets of duplicate leads and deletes them based on specified criteria",
                "operationId": "f491e10acf49f8044088e5b3a03ab5b9",
                "parameters": [
                    {
                        "name": "duplicate_data",
                        "in": "query",
                        "description": "JSON string containing duplicate lead data with email and lead_ids",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remove_old_or_new_lead",
                        "in": "query",
                        "description": "Whether to remove old or new leads ('old' or 'new')",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "old",
                                "new"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate leads deletion completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Duplicate records successfully deleted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/delete-duplicates": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete duplicate leads based on email and specified criteria",
                "operationId": "b589fdecf8eff1e98ff055cfe349a743",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to identify duplicate leads",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "Comma-separated list of lead IDs to process",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remove_lead",
                        "in": "query",
                        "description": "Whether to remove old or new leads ('old' or 'new')",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "old",
                                "new"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate leads deletion completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/get-leads-by-ecommerce-id/{ecommerce_id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get leads associated with a specific ecommerce ID",
                "operationId": "09db60a892c5aebda35f774bb1eb43c6",
                "parameters": [
                    {
                        "name": "ecommerce_id",
                        "in": "path",
                        "description": "Ecommerce ID to fetch leads for",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leads not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-delete-by-ecommerce-id/{ecommerceId}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Delete leads by ecommerce ID",
                "operationId": "9e707542161bebad493880f0ddda12b8",
                "parameters": [
                    {
                        "name": "ecommerceId",
                        "in": "path",
                        "description": "Ecommerce ID of the leads to delete",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "EC12345"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Leads Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leads not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-custom-feild/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get custom field data for a lead",
                "operationId": "1193e4874a95feed9acf13de78af4931",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead to get custom field data for",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean"
                                        },
                                        "results": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "label": {
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "type": "string"
                                                    },
                                                    "field_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-email-reply-list": {
            "post": {
                "tags": [
                    "Lead Inbox"
                ],
                "summary": "Get list of email replies",
                "operationId": "5d36f7e7423a4573a3bfa70ff6f166a9",
                "responses": {
                    "200": {
                        "description": "List of email replies retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01T00:00:00.000000Z"
                                                    },
                                                    "record_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "event": {
                                                        "type": "string",
                                                        "example": "lead_email_activity"
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "is_primary_contact": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "example": "john.doe@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-inbox-items": {
            "post": {
                "tags": [
                    "Lead Inbox"
                ],
                "summary": "Get all inbox items including emails, calls, and SMS",
                "operationId": "5f467760e72018ab3b5d9f5df95b46e7",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status (0 for unanswered/unreplied, 1 for answered/replied)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Inbox items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "emailList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "callList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "smsList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "whatsappList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "allItems": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-import-status": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get the status of lead import process",
                "operationId": "3fce66728d1def9e4d1418a040da4d37",
                "responses": {
                    "200": {
                        "description": "Import status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "import_status": {
                                            "properties": {
                                                "total_success_leads": {
                                                    "type": "integer",
                                                    "example": 150
                                                },
                                                "total_failed_leads": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "total_pending_leads": {
                                                    "type": "integer",
                                                    "example": 45
                                                },
                                                "total_leads_to_be_import": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "chunk_id": {
                                                    "type": "string",
                                                    "example": "abc123"
                                                },
                                                "lead_position_name": {
                                                    "type": "string",
                                                    "example": "prospect"
                                                },
                                                "completion_percentage": {
                                                    "type": "integer",
                                                    "example": 75
                                                },
                                                "success_percentage": {
                                                    "type": "integer",
                                                    "example": 75
                                                },
                                                "failed_percentage": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "pending_percentage": {
                                                    "type": "integer",
                                                    "example": 22
                                                },
                                                "is_import_completed": {
                                                    "type": "boolean",
                                                    "example": false
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "import_found": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No import found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Nothing to import!"
                                        },
                                        "import_found": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Multiple simultaneous imports found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Multiple simultaneous import found, something went wrong!"
                                        },
                                        "import_found": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/zapier-custom-fields-propagation-for-lead-position": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead positions for a Zapier user by username/email",
                "operationId": "670963b42d924b776ceb25c236ad5100",
                "parameters": [
                    {
                        "name": "userName",
                        "in": "query",
                        "description": "Email/username of the user whose client lead positions should be returned",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/zapier-lead-stages": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get lead position stages for the given lead position ID",
                "operationId": "aada49b0292a02dfc46a75955f90583f",
                "parameters": [
                    {
                        "name": "leadPositionId",
                        "in": "query",
                        "description": "ID of the lead position whose stages should be returned",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/remove-all-duplicate-leads-expect-current-lead": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Soft-delete all duplicate leads sharing an email except the given lead",
                "operationId": "30053446940cfbeea21c9ddce24c6550",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Primary contact email of the lead whose duplicates should be removed",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead to keep",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate leads removed successfully"
                    },
                    "404": {
                        "description": "Lead not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/guidelines-datatable": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get datatable of shortcode guidelines and custom fields for the client",
                "operationId": "bdc906298439dec32a720f5e4e710624",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-leads-by-ecommerce-id/{ecommerce_id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get leads by ecommerce ID",
                "operationId": "0ed8d136e2a6044a39ee2c5837aa07a0",
                "parameters": [
                    {
                        "name": "ecommerce_id",
                        "in": "path",
                        "description": "Ecommerce identifier associated with the leads",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead data fetched successfully"
                    },
                    "404": {
                        "description": "Lead not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-most-used-leads-notes": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get the most frequently used notes for the authenticated user's leads",
                "operationId": "68d1c439bba49a00df135a822bb3b734",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/form-save-in-lead-telagus-site": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Save a Telagus site form submission as a lead (reCAPTCHA protected)",
                "operationId": "686617f945483532c2a467f956f4b567",
                "parameters": [
                    {
                        "name": "g-recaptcha-response",
                        "in": "query",
                        "description": "Google reCAPTCHA v3 verification token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "form_id",
                        "in": "query",
                        "description": "Identifier of the form being submitted",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_details",
                        "in": "query",
                        "description": "Details of the submitting user",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "lead_contacts",
                        "in": "query",
                        "description": "Array of lead contact details (first_name, last_name, email, mobile_number, job_title)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "lead_companies",
                        "in": "query",
                        "description": "Array of lead company details (company_name, phone_number, country)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Form submission processed"
                    },
                    "422": {
                        "description": "Validation or reCAPTCHA failure"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-contact-reminders": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get contact reminders datatable for the authenticated user's client",
                "operationId": "3a28481702f3a6232dcee8ca22afab92",
                "parameters": [
                    {
                        "name": "next_contact_start_date",
                        "in": "query",
                        "description": "Start of the next-contact date range (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "next_contact_end_date",
                        "in": "query",
                        "description": "End of the next-contact date range (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "contact_type",
                        "in": "query",
                        "description": "Contact type ID to filter by",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Datatables search payload (search[value])",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/review-duplicates-datatable": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get datatable of duplicate lead candidates for review",
                "operationId": "41ea6dc7988f2c99a5d222e62177d7c1",
                "parameters": [
                    {
                        "name": "duplicate_data",
                        "in": "query",
                        "description": "Object describing duplicates: email (required) and at_lead_position (optional)",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/duplicates-datatable": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get datatable of duplicate leads grouped by email and lead position",
                "operationId": "bbe3caf3f4bcf6d3dfc6d1b0b9c02798",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-duplicates": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Soft-delete duplicate leads/contacts based on chosen strategy",
                "operationId": "3995fb5c89511bfcc87a919c1691fd1e",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address shared by the duplicate leads",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "Comma-separated list of duplicate lead IDs",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remove_lead",
                        "in": "query",
                        "description": "Which duplicate(s) to remove: 'new' to keep oldest, otherwise keep newest",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "new",
                                "old"
                            ]
                        }
                    },
                    {
                        "name": "lead_position",
                        "in": "query",
                        "description": "Lead position ID scoping the duplicates",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Duplicate records successfully deleted"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/template-save": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Save an email template (legacy lead template)",
                "operationId": "c0489880d3655241ece931e363af8d6c",
                "parameters": [
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "Display name of the template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Email domain (e.g. gmail, outlook)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject line",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mail_body",
                        "in": "query",
                        "description": "HTML body of the email template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email_signature",
                        "in": "query",
                        "description": "Optional email signature to append",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "append_signature",
                        "in": "query",
                        "description": "Whether to append the signature",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "file_names",
                        "in": "query",
                        "description": "Array of attachment file names",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template saved successfully"
                    },
                    "404": {
                        "description": "Failed to save template"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/template-save-new": {
            "post": {
                "tags": [
                    "Leads"
                ],
                "summary": "Save a new campaign template",
                "operationId": "aacfe050b8e328b7da873bcb935f7df2",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the campaign template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_plain",
                        "in": "query",
                        "description": "Whether the template is plain text",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "html_body",
                        "in": "query",
                        "description": "HTML body of the template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template saved successfully"
                    },
                    "404": {
                        "description": "Failed to save template"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-template": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get all saved campaign templates for the authenticated client",
                "operationId": "3ce0e0b98fafb88b13a8d9b34c75ecd7",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "No templates found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-template/{id}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get a saved lead email template by ID",
                "operationId": "ea715a204f7debd762d8d0e25e2e41f3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead template",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "dir",
                        "in": "query",
                        "description": "Attachment directory hint (e.g. gmail-attachments, outlook-attachments)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-template-new/{campaignTemplate}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get a campaign template by route-bound model",
                "operationId": "e215a409d8433da1e524a4553fdd1c29",
                "parameters": [
                    {
                        "name": "campaignTemplate",
                        "in": "path",
                        "description": "ID of the campaign template",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/getTemplateFile/{filename}": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get metadata for a stored template attachment file",
                "operationId": "4efeafaf5aa394f179ed586392157dfb",
                "parameters": [
                    {
                        "name": "filename",
                        "in": "path",
                        "description": "Stored file name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Source type: 'outlook' for outlook-attachments, otherwise gmail-attachments",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "gmail",
                                "outlook"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File metadata returned"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-lead-fields": {
            "get": {
                "tags": [
                    "Leads"
                ],
                "summary": "Get all available lead fields including custom fields",
                "operationId": "d388ab72096c971198d61024529a605d",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-fields": {
            "get": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Get lead fields settings for the authenticated user",
                "operationId": "b355de6cf1fe91428ac39a7f9e595c2f",
                "responses": {
                    "200": {
                        "description": "List of lead field settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "user_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "field_name": {
                                                "type": "string",
                                                "example": "first_name"
                                            },
                                            "label": {
                                                "type": "string",
                                                "example": "First Name"
                                            },
                                            "label_position_wise": {
                                                "type": "string"
                                            },
                                            "visibility": {
                                                "type": "boolean",
                                                "example": true
                                            },
                                            "visibility_position_wise": {
                                                "type": "string"
                                            },
                                            "quick_search": {
                                                "type": "boolean",
                                                "example": true
                                            },
                                            "sort": {
                                                "type": "integer",
                                                "example": 1
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-fields-settings": {
            "get": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Get field settings with lead positions",
                "operationId": "8938ef74d65bf522ef37f79a0188045f",
                "responses": {
                    "200": {
                        "description": "Field settings with lead positions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "settings": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "field_name": {
                                                        "type": "string",
                                                        "example": "first_name"
                                                    },
                                                    "label": {
                                                        "type": "string",
                                                        "example": "First Name"
                                                    },
                                                    "label_position_wise": {
                                                        "type": "object"
                                                    },
                                                    "visibility": {
                                                        "type": "boolean",
                                                        "example": true
                                                    },
                                                    "visibility_position_wise": {
                                                        "type": "object"
                                                    },
                                                    "quick_search": {
                                                        "type": "boolean",
                                                        "example": true
                                                    },
                                                    "sort": {
                                                        "type": "integer",
                                                        "example": 1
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "lead_positions": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Save field settings",
                "operationId": "9a15f9a617ff978a6f9d36aa365881a3",
                "parameters": [
                    {
                        "name": "settings",
                        "in": "query",
                        "description": "Field settings to save",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead fields settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/label-position-wise-update": {
            "post": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Update label position wise settings",
                "operationId": "1bf1ed16078830fb8455dfa89de64ecb",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_name",
                        "in": "query",
                        "description": "Field name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "label_position_wise",
                        "in": "query",
                        "description": "Label position wise value",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead fields settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Lead position not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead position id not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/visibility-position-wise-update": {
            "post": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Update visibility position wise settings",
                "operationId": "dafb822795d200a1369f427d064fdff7",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "field_name",
                        "in": "query",
                        "description": "Field name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "visibility_position_wise",
                        "in": "query",
                        "description": "Visibility position wise value",
                        "required": true,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead fields settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Lead position not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead position id not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-fields-order-change": {
            "post": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Change the order of lead fields",
                "operationId": "4eafca220e8b96a543d23c0b3cf85dbd",
                "parameters": [
                    {
                        "name": "order_change",
                        "in": "query",
                        "description": "Array of field IDs in the desired order",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order changed successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-fields-visibility-details": {
            "post": {
                "tags": [
                    "Lead Fields Settings"
                ],
                "summary": "Get field visibility details for a specific lead position",
                "operationId": "1c8cca828ba3d14841f27246571e4e15",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "Lead position ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Field visibility details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "get_field_visibility_details": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "label_name": {
                                                        "type": "string"
                                                    },
                                                    "visibility": {
                                                        "type": "boolean"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Field visibility not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Field Visibility Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-files": {
            "get": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Get all lead files",
                "operationId": "813f8c46b2afe24ae8833e3b0e9a0f18",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_files": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead Files Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Store a new lead file",
                "operationId": "e38b78c03bb8ba5eadd6dd4d85e65401",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_category_id",
                        "in": "query",
                        "description": "ID of the attachment category",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LeadFile Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadFile Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-files/{id}": {
            "get": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Get a specific lead file",
                "operationId": "3bd370f8422be93583f5429dfc4e9c81",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead file",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_files": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No LeadFile Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Update a lead file",
                "operationId": "6c784333be9a60e80ca10cd579382937",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead file",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LeadFile Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadFile Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "LeadFile Not Found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Delete a lead file",
                "operationId": "e7b7e83b278d81e3dd92e0018222c091",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead file",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "LeadFile Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadFile Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "LeadFile Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/download-attachment": {
            "get": {
                "tags": [
                    "Lead Files"
                ],
                "summary": "Download a lead-files attachment",
                "description": "Returns the file contents (from S3 when filesystems.default=s3, otherwise from local storage under `storage/leads-files/`).",
                "operationId": "leadFilesDownloadAttachment",
                "parameters": [
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "File name (relative to the leads-files directory)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "proposal-2025.pdf"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Binary file contents",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "file_name missing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "File not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-filter-template": {
            "get": {
                "tags": [
                    "Lead Filter Templates"
                ],
                "summary": "Get all lead filter templates for the authenticated user",
                "operationId": "a67347dc876171437c380e0ae6a9ccf4",
                "responses": {
                    "200": {
                        "description": "List of templates retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "templates": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_by": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "template_name": {
                                                        "type": "string",
                                                        "example": "My Filter Template"
                                                    },
                                                    "filter": {
                                                        "type": "object",
                                                        "example": {
                                                            "field": "value"
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "No templates found or server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Filter Templates"
                ],
                "summary": "Create a new lead filter template",
                "operationId": "22b108efac2efd09a36ff821f52873e1",
                "parameters": [
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "Name of the filter template",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "My New Filter"
                        }
                    },
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "Filter criteria in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": {
                                "field": "value"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "template_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "template_name": {
                                                    "type": "string",
                                                    "example": "My New Filter"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Filter saved as template successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-filter-template/{leadFilterTemplate}": {
            "get": {
                "tags": [
                    "Lead Filter Templates"
                ],
                "summary": "Get a specific lead filter template",
                "operationId": "6492643f379f77481fbfdab09dded188",
                "parameters": [
                    {
                        "name": "leadFilterTemplate",
                        "in": "path",
                        "description": "ID of the lead filter template",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "template": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "created_by": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "template_name": {
                                                    "type": "string",
                                                    "example": "My Filter Template"
                                                },
                                                "filter": {
                                                    "type": "string",
                                                    "example": {
                                                        "field": "value"
                                                    }
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Filter Templates"
                ],
                "summary": "Update a lead filter template name",
                "operationId": "7e799a5793571885f47a6118281ce822",
                "parameters": [
                    {
                        "name": "leadFilterTemplate",
                        "in": "path",
                        "description": "ID of the lead filter template",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "template_name",
                        "in": "query",
                        "description": "New name for the filter template",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Filter Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Filter template name updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Filter Templates"
                ],
                "summary": "Delete a lead filter template",
                "operationId": "f67915fa90aac4b33c179dab5e0d47f8",
                "parameters": [
                    {
                        "name": "leadFilterTemplate",
                        "in": "path",
                        "description": "ID of the lead filter template to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Filter template deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position": {
            "get": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get all lead positions for the authenticated user's client",
                "operationId": "3ca7312a059fe30fe77551cf374c83a0",
                "responses": {
                    "200": {
                        "description": "List of lead positions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Create a new lead position",
                "operationId": "ad1b47e74fe67fdb0ea80cfef26c6fba",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "has_stages",
                        "in": "query",
                        "description": "Whether the lead position has stages",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Added Successfully"
                                        },
                                        "lead_position": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position/data-table/get": {
            "post": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get lead positions in DataTable format",
                "operationId": "bfff963202150b643851f6a9d4e21752",
                "responses": {
                    "200": {
                        "description": "Lead positions data in DataTable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position/{id}": {
            "get": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get a specific lead position",
                "operationId": "6a4bd6d5cf6971a01ffb92860db177d5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Update a lead position",
                "operationId": "351bed009ecd1742e9ebb689af62943a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    },
                    {
                        "name": "has_stages",
                        "in": "query",
                        "description": "Whether the lead position has stages",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Updated Successfully"
                                        },
                                        "lead_position": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Delete a lead position",
                "operationId": "b1ae32feeda23777332aa388f27431b6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position/{id}/list-lead-position-stage-sets": {
            "get": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get all stage sets for a specific lead position",
                "operationId": "2b7b595541ac6d1486e7a600a1a52c2a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of lead position stage sets",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage-set/{id}/list-lead-position-stages": {
            "get": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get all stages for a specific lead position stage set",
                "operationId": "52dce7bdfa933f6c6cc429b983c6a5d3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of lead position stages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-positions-by-user": {
            "post": {
                "tags": [
                    "Lead Positions"
                ],
                "summary": "Get lead positions for a specific user",
                "operationId": "29a84491e5bec6b102e30c76246e1187",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of lead positions for the user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_position": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position/{id}/get-stages-by-position": {
            "get": {
                "tags": [
                    "Lead Position"
                ],
                "summary": "List stages for a given lead position",
                "description": "Returns all LeadPositionStage rows under the given LeadPosition (joined via LeadPositionStageSet), sorted by stage sort order. Soft-deleted stages or sets are excluded.",
                "operationId": "leadPositionGetStagesByPosition",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "LeadPosition ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stages list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "sort": {
                                                        "type": "integer"
                                                    },
                                                    "stage_set_name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage": {
            "get": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Get all lead position stages",
                "operationId": "0f9baea39f142936501073fb90f5ec35",
                "responses": {
                    "200": {
                        "description": "List of lead position stages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "lead_position_stage_set_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "name": {
                                                "type": "string",
                                                "example": "Initial Contact"
                                            },
                                            "sort": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "state": {
                                                "type": "string",
                                                "example": "active"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Create a new lead position stage",
                "operationId": "d02a1f79b1fd475742021b5568f2fb23",
                "parameters": [
                    {
                        "name": "lead_position_stage_set_id",
                        "in": "query",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position stage",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Initial Contact"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order of the lead position stage",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State of the lead position stage (active, won, lost)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "active"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Added Successfully"
                                        },
                                        "lead_position_stage": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "lead_position_stage_set_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Initial Contact"
                                                },
                                                "sort": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "state": {
                                                    "type": "string",
                                                    "example": "active"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage/{id}": {
            "get": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Get a specific lead position stage",
                "operationId": "fde658d6f6c487e9945de699265df6c0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "lead_position_stage_set_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "Initial Contact"
                                        },
                                        "sort": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "state": {
                                            "type": "string",
                                            "example": "active"
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position stage not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Lead Position Stage Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Update a specific lead position stage",
                "operationId": "bdef7c9258487128d811ad60cfe708f1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "lead_position_stage_set_id",
                        "in": "query",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position stage",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Initial Contact"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order of the lead position stage",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State of the lead position stage (active, won, lost)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "active"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Updated Successfully"
                                        },
                                        "lead_position_stage": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "lead_position_stage_set_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "example": "Initial Contact"
                                                },
                                                "sort": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "state": {
                                                    "type": "string",
                                                    "example": "active"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Lead position stage not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Delete a specific lead position stage",
                "operationId": "cd6b0d540a1b6dc82d0e00f173bfda1c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Deleted Successfully"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position stage not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage-check-state": {
            "post": {
                "tags": [
                    "Lead Position Stage"
                ],
                "summary": "Check if a state already exists for a lead position stage set",
                "description": "Check if a state already exists for a lead position stage set",
                "operationId": "f36903240b765003bed2ebe1d391c7fc",
                "parameters": [
                    {
                        "name": "lead_position_stage_set_id",
                        "in": "query",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State to check (won or lost)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "won"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "State check completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": ""
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage-set": {
            "get": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Get all lead position stage sets for the authenticated user's client",
                "operationId": "49304a83af7ff1abe2d4f919c8c538c7",
                "responses": {
                    "200": {
                        "description": "List of lead position stage sets",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Create a new lead position stage set",
                "operationId": "f558e12ba57adde3e2f869997faea86a",
                "parameters": [
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "ID of the lead position",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage set created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Set Added Successfully"
                                        },
                                        "lead_position_stage_set": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage-set/data-table/get": {
            "post": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Get lead position stage sets for DataTables",
                "operationId": "49ff9973d9381c01d87f2218ac7eccda",
                "responses": {
                    "200": {
                        "description": "DataTables compatible JSON response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-position-stage-set/{id}": {
            "get": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Get a specific lead position stage set",
                "operationId": "0b510a508e7fe98add86d7a4a6e53cc8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage set details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position stage set not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Lead Position Stage Set Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Update a lead position stage set",
                "operationId": "3f4473f7686a4ff1be2b65ee63be31c1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_position_id",
                        "in": "query",
                        "description": "ID of the lead position",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 191
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage set updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Set Updated Successfully"
                                        },
                                        "lead_position_stage_set": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Lead position stage set not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Position Stage Set"
                ],
                "summary": "Delete a lead position stage set",
                "operationId": "84e1c6fea3e9ded8b3c309470aa5f72b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead position stage set",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position stage set deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Set Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead position stage set not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Position Stage Set Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/filter-options": {
            "get": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Distinct values for the report dashboard filters",
                "description": "Returns the distinct lead sources, company countries, primary-contact job titles, parsed tag names, and users for the authenticated user's client, used to populate the dashboard's multi-select filters. Takes no parameters.",
                "operationId": "968b6b321c25a6398c3fea70f6e6bbd1",
                "responses": {
                    "200": {
                        "description": "Filter option lists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_sources": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "Referral",
                                                "Website"
                                            ]
                                        },
                                        "countries": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "United Kingdom"
                                            ]
                                        },
                                        "job_titles": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "Managing Director"
                                            ]
                                        },
                                        "tags": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "hot",
                                                "newsletter"
                                            ]
                                        },
                                        "users": {
                                            "description": "Client users for the assigned-to filter",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 3
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/summary": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "KPI summary band",
                "description": "Total leads, growth vs the immediately preceding window of equal length (only when start_date+end_date are supplied — otherwise previous/percentage are null), average days in pipeline (created_at to close_date), lead-to-quote ratio, and the conversion metric configured by the client's conversion_ratio setting (lead-position move or quote acceptance). All report endpoints are scoped to the user's client and to assigned leads only when the user has 'read assigned leads' but not 'read all leads'. Filters are read unvalidated from the body; an empty {} body is valid.",
                "operationId": "8842bc57e8625c5fa7a3d6b03381c7fb",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All fields optional.",
                                "properties": {
                                    "start_date": {
                                        "description": "Range start; only applied when end_date is also present",
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-01-01"
                                    },
                                    "end_date": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-06-30"
                                    },
                                    "date_field": {
                                        "description": "Which date the range filters on; last_activity matches leads with any task/email/SMS/call/note created in the range",
                                        "type": "string",
                                        "example": "created_at",
                                        "enum": [
                                            "created_at",
                                            "close_date",
                                            "last_activity"
                                        ]
                                    },
                                    "assigned_to": {
                                        "description": "User IDs; the literal string 'unassigned' matches leads with no assignee. A scalar is also accepted.",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": [
                                            "3",
                                            "unassigned"
                                        ]
                                    },
                                    "lead_source": {
                                        "description": "Array (or scalar) of lead sources",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "country": {
                                        "description": "Array (or scalar) of company countries",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "job_title": {
                                        "description": "Array (or scalar) of contact job titles",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "tags": {
                                        "description": "Array (or scalar) of tag names, matched with LIKE against the per-lead tag blob",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "price_min": {
                                        "description": "Minimum lead price (inclusive)",
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "price_max": {
                                        "description": "Maximum lead price (inclusive)",
                                        "type": "number",
                                        "format": "float"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "KPI summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "total_leads": {
                                            "type": "integer",
                                            "example": 120
                                        },
                                        "previous_total_leads": {
                                            "description": "Lead count in the preceding window of equal length; null when no date range was supplied",
                                            "type": "integer",
                                            "example": 100,
                                            "nullable": true
                                        },
                                        "growth_percentage": {
                                            "description": "Growth vs previous window; 100 when previous is 0 but current > 0; null when no date range",
                                            "type": "number",
                                            "format": "float",
                                            "example": 20,
                                            "nullable": true
                                        },
                                        "avg_pipeline_days": {
                                            "description": "Average DATEDIFF(close_date, created_at) over leads with a close_date; null when none",
                                            "type": "number",
                                            "format": "float",
                                            "example": 14.5,
                                            "nullable": true
                                        },
                                        "lead_to_quote": {
                                            "properties": {
                                                "with_quotes": {
                                                    "type": "integer",
                                                    "example": 45
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 120
                                                },
                                                "percentage": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 37.5
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "conversion": {
                                            "properties": {
                                                "mode": {
                                                    "type": "string",
                                                    "example": "convert_to_other_lead_position",
                                                    "enum": [
                                                        "convert_to_other_lead_position",
                                                        "quote_acceptance"
                                                    ]
                                                },
                                                "label": {
                                                    "type": "string",
                                                    "example": "Converted to Clients"
                                                },
                                                "numerator": {
                                                    "type": "integer",
                                                    "example": 30
                                                },
                                                "denominator": {
                                                    "type": "integer",
                                                    "example": 120
                                                },
                                                "percentage": {
                                                    "type": "number",
                                                    "format": "float",
                                                    "example": 25
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-month": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Leads created vs closed per calendar month",
                "description": "Trend-chart series: parallel arrays of month labels, created counts, and closed counts. Labels are the union of months where any lead was created or closed, sorted ascending. Accepts the shared filter payload (see /api/leads/reports/summary); an empty {} body is valid.",
                "operationId": "8766c8447843a79017cdb520403a48c3",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload (start_date, end_date, date_field, assigned_to, lead_source, country, job_title, tags, price_min, price_max). All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Monthly trend series (parallel arrays)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "labels": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "Jan 2026",
                                                "Feb 2026"
                                            ]
                                        },
                                        "created": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            },
                                            "example": [
                                                12,
                                                18
                                            ]
                                        },
                                        "closed": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            },
                                            "example": [
                                                7,
                                                11
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-salesperson": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Lead count and total value per assigned salesperson",
                "description": "Groups leads by assigned_to (left join on users), ordered by lead count descending. Leads with no assignee (or a blank user name) appear as 'Unassigned'. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "ced5c023d8592ed8384bef4fccede712",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-salesperson totals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "assigned_to": {
                                                        "type": "integer",
                                                        "example": 3,
                                                        "nullable": true
                                                    },
                                                    "full_name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    },
                                                    "lead_count": {
                                                        "type": "integer",
                                                        "example": 42
                                                    },
                                                    "total_price": {
                                                        "description": "SUM(leads.price); null when all prices are null",
                                                        "type": "number",
                                                        "format": "float",
                                                        "example": 15250,
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-source": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Lead count and value per lead source",
                "description": "Groups leads (with a non-empty lead_source) by source, ordered by count descending, returned as parallel arrays. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "69bb03602b7425e8421c5e6fbc7b9fbb",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-source totals (parallel arrays)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leadSource": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "Website",
                                                "Referral"
                                            ]
                                        },
                                        "leadCount": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            },
                                            "example": [
                                                30,
                                                12
                                            ]
                                        },
                                        "leadAmount": {
                                            "description": "SUM(leads.price) per source; entries may be null",
                                            "type": "array",
                                            "items": {
                                                "type": "number",
                                                "format": "float",
                                                "nullable": true
                                            },
                                            "example": [
                                                9800,
                                                4100
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-amount-range": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Leads bucketed by deal value range",
                "description": "Buckets leads into three fixed price ranges: under £500, £500–2k, and £2k+. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "737d827928af9f5fd7c418ef900044bd",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Fixed-bucket counts (parallel arrays)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "labels": {
                                            "description": "Always the three fixed bucket labels",
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "£0–500",
                                                "£500–2k",
                                                "£2k+"
                                            ]
                                        },
                                        "counts": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            },
                                            "example": [
                                                25,
                                                40,
                                                15
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-country": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Leads grouped by company country",
                "description": "Distinct-lead counts grouped by the country on the lead's (non-deleted) company rows, ordered by count descending, capped at 20 countries. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "cfa906bacb20cd9a1ffad07269433aeb",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-country lead counts (top 20)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "country": {
                                                        "type": "string",
                                                        "example": "United Kingdom"
                                                    },
                                                    "lead_count": {
                                                        "type": "integer",
                                                        "example": 34
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-job-title": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Leads grouped by primary contact job title",
                "description": "Distinct-lead counts grouped by the job title of the lead's primary contact (is_primary_contact=1, not deleted), ordered by count descending, capped at 15 titles. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "080c0a85ae62ccec4319f1c8418f9efd",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-job-title lead counts (top 15)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "job_title": {
                                                        "type": "string",
                                                        "example": "Managing Director"
                                                    },
                                                    "lead_count": {
                                                        "type": "integer",
                                                        "example": 21
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/by-tags": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Leads grouped by tag",
                "description": "Tags are stored as a text blob per lead (JSON array, array of objects, or delimited string), so they are parsed in PHP and tallied; the top 15 tags by lead count are returned. If the lead_tag table doesn't exist, an empty data array is returned. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "24ff4984b4f3b372f4f5f8c8787537ef",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Per-tag lead counts (top 15)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "tag": {
                                                        "type": "string",
                                                        "example": "hot"
                                                    },
                                                    "lead_count": {
                                                        "type": "integer",
                                                        "example": 18
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/activity-summary": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Average activity volume per lead",
                "description": "Averages of emails (campaign_emails), calls (lead_call_logs), SMS (sms_trackings) and appointments (lead_tasks with activity=appointment) per filtered lead, plus the count of leads with no activity in any of those tables. Averages are 0 when there are no leads. Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "eb275e01673fc2b2604f5f9f4de526c3",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Activity averages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "total_leads": {
                                            "type": "integer",
                                            "example": 120
                                        },
                                        "avg_emails": {
                                            "type": "number",
                                            "format": "float",
                                            "example": 2.35
                                        },
                                        "avg_calls": {
                                            "type": "number",
                                            "format": "float",
                                            "example": 0.85
                                        },
                                        "avg_sms": {
                                            "type": "number",
                                            "format": "float",
                                            "example": 0.4
                                        },
                                        "avg_appointments": {
                                            "type": "number",
                                            "format": "float",
                                            "example": 0.6
                                        },
                                        "no_activity_count": {
                                            "description": "Leads with no emails, calls, SMS, or tasks at all",
                                            "type": "integer",
                                            "example": 14
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leads/reports/funnel": {
            "post": {
                "tags": [
                    "Lead Reports"
                ],
                "summary": "Acquisition funnel: total → quote issued → converted",
                "description": "Three fixed stages: total leads; leads with a quote (lead_quotes row) or a sent estimate; and converted leads per the client's conversion_ratio setting (moved to the configured lead position, or quote accepted). The third stage's label reflects that setting (e.g. 'Converted to Clients' or 'Quote Accepted'). Accepts the shared filter payload (see /api/leads/reports/summary).",
                "operationId": "a7f46c748094a75839dcf779127dca01",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Shared report filter payload. All optional.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Funnel stages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "description": "Always three stage rows in funnel order",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "stage": {
                                                        "type": "string",
                                                        "example": "Quote Issued"
                                                    },
                                                    "count": {
                                                        "type": "integer",
                                                        "example": 45
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "conversion_mode": {
                                            "type": "string",
                                            "example": "convert_to_other_lead_position",
                                            "enum": [
                                                "convert_to_other_lead_position",
                                                "quote_acceptance"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-profile": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get lead profile information",
                "operationId": "76ec1c6b2b3ee204d5d9f2b15b8d01cd",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead profile information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_info": {
                                            "type": "object",
                                            "nullable": true
                                        },
                                        "lead_empty_columns": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "company_empty_columns": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "contact_empty_columns": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "profile_percentage": {
                                            "type": "integer",
                                            "example": 75
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-position-history": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get lead position history",
                "operationId": "2527f170c3885e7264e4f7f811a76115",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead position history retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "all_lead_positions": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Position Name"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "current_lead_position": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "remaining_steps": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "position_percentage": {
                                            "type": "integer",
                                            "example": 40
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-email-conversation": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get lead email conversations",
                "operationId": "ec1a16926f28d01603a3a30456c663b5",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead email conversations retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "email_conversations": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "email_subject": {
                                                        "type": "string",
                                                        "example": "Meeting Request"
                                                    },
                                                    "email_to": {
                                                        "type": "string",
                                                        "example": "client@example.com"
                                                    },
                                                    "sent_by": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "cc": {
                                                        "type": "string",
                                                        "example": "manager@example.com"
                                                    },
                                                    "bcc": {
                                                        "type": "string",
                                                        "example": "admin@example.com"
                                                    },
                                                    "attachments": {
                                                        "type": "string",
                                                        "example": "document.pdf"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-tasks": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get tasks associated with a lead",
                "operationId": "59f2f0732977228c06148b36b6586af8",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_tasks": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Follow up call"
                                                    },
                                                    "type_of_task": {
                                                        "type": "string",
                                                        "example": "Call"
                                                    },
                                                    "task_status": {
                                                        "type": "string",
                                                        "example": "Completed"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-smses": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get SMS messages associated with a lead",
                "operationId": "1b01213b5f4275091684d055033e338c",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead SMS messages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_smses": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "sms_recipient_number": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "sms_created_by": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "from_name": {
                                                        "type": "string",
                                                        "example": "Company Name"
                                                    },
                                                    "from_number": {
                                                        "type": "string",
                                                        "example": "+0987654321"
                                                    },
                                                    "sms_content": {
                                                        "type": "string",
                                                        "example": "Hello, this is a test message"
                                                    },
                                                    "sms_created_at": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-calls": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get call logs associated with a lead",
                "operationId": "fe72329330f38be64e0074de14cbc988",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead call logs retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_calls": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "called_by_name": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "called_to_name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    },
                                                    "called_from_number": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "called_to_number": {
                                                        "type": "string",
                                                        "example": "+0987654321"
                                                    },
                                                    "call_status": {
                                                        "type": "string",
                                                        "example": "completed"
                                                    },
                                                    "direction": {
                                                        "type": "string",
                                                        "example": "outbound"
                                                    },
                                                    "call_duration": {
                                                        "type": "string",
                                                        "example": "00:05:30"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-campaigns": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get campaigns associated with a lead",
                "operationId": "2a8383117ca6fd08eeb9009b77b9f3c2",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead campaigns retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_campaigns": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "campaign_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "send_to_email": {
                                                        "type": "string",
                                                        "example": "client@example.com"
                                                    },
                                                    "send_to_name": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "campaign_title": {
                                                        "type": "string",
                                                        "example": "Monthly Newsletter"
                                                    },
                                                    "is_followup": {
                                                        "type": "boolean",
                                                        "example": false
                                                    },
                                                    "from_name": {
                                                        "type": "string",
                                                        "example": "Company Name"
                                                    },
                                                    "from_email": {
                                                        "type": "string",
                                                        "example": "info@company.com"
                                                    },
                                                    "reply_to": {
                                                        "type": "string",
                                                        "example": "support@company.com"
                                                    },
                                                    "send_by_name": {
                                                        "type": "string",
                                                        "example": "Jane Smith"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-appointments": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get appointments associated with a lead",
                "operationId": "a38c06885cb3df737cc945d2efee149e",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead appointments retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_appointments": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Initial Consultation"
                                                    },
                                                    "appointment_type": {
                                                        "type": "string",
                                                        "example": "Meeting"
                                                    },
                                                    "appointment_created_by": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-quotes": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get quotes associated with a lead",
                "operationId": "34b5c13f0b9a0b6724b9a5a8a8e62469",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead quotes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_quotes": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "quote_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "quotation_for_lead": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "quote_item_titles": {
                                                        "type": "string",
                                                        "example": "Service 1,Service 2"
                                                    },
                                                    "total_amount": {
                                                        "type": "number",
                                                        "example": 1000
                                                    },
                                                    "quote_created_by_name": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "quatation_date": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    },
                                                    "cc": {
                                                        "type": "string",
                                                        "example": "manager@example.com"
                                                    },
                                                    "bcc": {
                                                        "type": "string",
                                                        "example": "admin@example.com"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "Sent"
                                                    },
                                                    "last_email_sent_date": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    },
                                                    "sent_to": {
                                                        "type": "string",
                                                        "example": "client@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-lead-invoices": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get invoices associated with a lead",
                "operationId": "d5b486762c377face73e6f10559d7060",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead invoices retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "lead_invoices": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "invoice_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "invoice_for_lead": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "invoice_date": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "Paid"
                                                    },
                                                    "sent_to": {
                                                        "type": "string",
                                                        "example": "client@example.com"
                                                    },
                                                    "last_email_sent_date": {
                                                        "type": "string",
                                                        "example": "2023-01-01 12:00:00"
                                                    },
                                                    "invoice_item_titles": {
                                                        "type": "string",
                                                        "example": "Service 1,Service 2"
                                                    },
                                                    "total_amount": {
                                                        "type": "number",
                                                        "example": 1000
                                                    },
                                                    "bill_to_name": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "bill_to_email": {
                                                        "type": "string",
                                                        "example": "client@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-summary-of-lead-activities": {
            "get": {
                "tags": [
                    "Lead Score"
                ],
                "summary": "Get a summary of all activities associated with a lead",
                "operationId": "a2220f6422f073e07bb4900b63306e77",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead activities summary retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "email_conversation_counts": {
                                            "type": "integer",
                                            "example": 5
                                        },
                                        "lead_task_counts": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "lead_sms_counts": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "lead_call_counts": {
                                            "type": "integer",
                                            "example": 4
                                        },
                                        "lead_campaign_counts": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "lead_appointment_counts": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "lead_quote_counts": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "lead_invoice_counts": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "engagement_percentage": {
                                            "type": "integer",
                                            "example": 75
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-source-options": {
            "get": {
                "tags": [
                    "Lead Source Settings"
                ],
                "summary": "Get lead source settings and lead positions",
                "operationId": "a6c3cd2fb822e314b8ccb77ec8614901",
                "responses": {
                    "200": {
                        "description": "Lead source settings and lead positions retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "settings": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "lead_positions": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Source Settings"
                ],
                "summary": "Save lead source settings",
                "operationId": "e2e9a305757ea95f07b22961cdf11ef3",
                "parameters": [
                    {
                        "name": "settings",
                        "in": "query",
                        "description": "Array of lead source settings to save",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Website"
                                    },
                                    "visibility_position_wise": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "sort": {
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-source-options/{id}": {
            "put": {
                "tags": [
                    "Lead Source Settings"
                ],
                "summary": "Update lead source setting",
                "operationId": "5da4cec884f519e70ebb30bdbf41dcc4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead source setting to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the lead source",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Website"
                        }
                    },
                    {
                        "name": "visibility_position_wise",
                        "in": "query",
                        "description": "Array of position IDs where this lead source is visible",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order of the lead source",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tags": {
            "get": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Get list of lead tags",
                "operationId": "4ce27d1c85e013c89cfcac249f6ef65a",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Create a new lead tag",
                "operationId": "39fd00ca85eea9f9aa305106c08721fc",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead to associate the tag with",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "tags",
                        "in": "query",
                        "description": "Comma-separated list of tags",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tag added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Tag Added Successfully"
                                        },
                                        "lead_tag": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tags/{lead_tag}": {
            "get": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Display the specified lead tag",
                "operationId": "8deb55576d5f55923bf394c3397b6b65",
                "parameters": [
                    {
                        "name": "lead_tag",
                        "in": "path",
                        "description": "ID of the lead tag",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "Lead tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Update the specified lead tag",
                "operationId": "be278539c17ff638853ef33baf8ced00",
                "parameters": [
                    {
                        "name": "lead_tag",
                        "in": "path",
                        "description": "ID of the lead tag to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tag updated successfully"
                    },
                    "404": {
                        "description": "Lead tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Delete the specified lead tag",
                "operationId": "6aae7c4582a4344af9f42a297c72b34f",
                "parameters": [
                    {
                        "name": "lead_tag",
                        "in": "path",
                        "description": "ID of the lead tag to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tag deleted successfully"
                    },
                    "404": {
                        "description": "Lead tag not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tags/by-lead/{lead_id}": {
            "get": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Get the tags assigned to a specific lead",
                "operationId": "d5c61b5cc6a583174181a675b3525f73",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "path",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tags retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tags/update-tags/{leadId}": {
            "put": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Update (or create) the tags for a specific lead",
                "operationId": "f223951005f2eeafd5c25101a99e1142",
                "parameters": [
                    {
                        "name": "leadId",
                        "in": "path",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "tags",
                        "in": "query",
                        "description": "Comma-separated list of tags",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tags updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Tags updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tags-all": {
            "get": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Get all unique tags across leads for the current client",
                "operationId": "020edf6ddcf01d977ff091ae5404be3b",
                "responses": {
                    "200": {
                        "description": "Unique tags retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-tag-to-selected-leads": {
            "post": {
                "tags": [
                    "Lead Tags"
                ],
                "summary": "Add a tag (or tags) to multiple selected leads",
                "operationId": "03b2c253bf16772f14c9017a4c05743a",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Array of lead IDs to receive the tag",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "description": "Single tag or comma-separated list of tags",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tags added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Tags added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-comments": {
            "get": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Get a list of lead comments",
                "operationId": "f70aa827fbe3b00f6f682632e5b2637e",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Store a new lead task comment",
                "operationId": "815186a1a0b04ebf51044351d8f56596",
                "parameters": [
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Comment description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "task_id",
                        "in": "query",
                        "description": "ID of the task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_name[]",
                        "in": "query",
                        "description": "Attachment files",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Comment Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-comments/{id}": {
            "get": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Get comments for a specific lead",
                "operationId": "fba148a59496d825b282c76e104dd4e8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Resource not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Delete a lead task comment",
                "operationId": "8dd3ebc5eab27825d940d3149cacea39",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Comment Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Comment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Comment Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tasks-comment/{tid}": {
            "get": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Get comments for a specific task",
                "operationId": "91e62ddd9aa74c66c7c6b85685f6e7a0",
                "parameters": [
                    {
                        "name": "tid",
                        "in": "path",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Resource not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-tasks-comment/download-attachment": {
            "get": {
                "tags": [
                    "Lead Task Comments"
                ],
                "summary": "Download an attachment from a comment",
                "operationId": "42ab37789000b6c17d0515e80e601766",
                "parameters": [
                    {
                        "name": "comment_id",
                        "in": "query",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment in the files array",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download response"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-comments/{lead_comment}": {
            "put": {
                "tags": [
                    "Lead Task Comment"
                ],
                "summary": "Update a lead comment (resource update – placeholder, not currently implemented)",
                "operationId": "d63665d7bada77a56b5f50457f4cf11e",
                "parameters": [
                    {
                        "name": "lead_comment",
                        "in": "path",
                        "description": "Lead comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task": {
            "get": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get a list of all lead tasks",
                "operationId": "23c32342157c767869b0478fad8547fa",
                "responses": {
                    "200": {
                        "description": "List of lead tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Create a new lead task",
                "operationId": "68fc73b391ff18cfa056f547860693ad",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the task",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Follow up call"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Call the lead to discuss the proposal"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the task to",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "lead_task_status_id",
                        "in": "query",
                        "description": "Status ID of the task",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "due_date_time",
                        "in": "query",
                        "description": "Due date and time for the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 12:00:00"
                        }
                    },
                    {
                        "name": "remainder_time",
                        "in": "query",
                        "description": "Reminder date and time for the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 10:00:00"
                        }
                    },
                    {
                        "name": "set_remainder",
                        "in": "query",
                        "description": "Type of reminder to set (sms_email, sms, email, none)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "email",
                            "enum": [
                                "sms_email",
                                "sms",
                                "email",
                                "none"
                            ]
                        }
                    },
                    {
                        "name": "activity",
                        "in": "query",
                        "description": "Type of activity (followup, appointment, call, todo, none)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "call",
                            "enum": [
                                "followup",
                                "appointment",
                                "call",
                                "todo",
                                "none"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead task created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadTask Added Successfully"
                                        },
                                        "lead_task": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task/data-table/get": {
            "post": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get lead tasks data for datatable",
                "operationId": "dd520035687b9f697e37b4df25f3ae7f",
                "responses": {
                    "200": {
                        "description": "Lead tasks data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task/get-all-tasks/get": {
            "post": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get all lead tasks with filtering options",
                "operationId": "47790017f78e9790dd079e03a4ad0b59",
                "parameters": [
                    {
                        "name": "is_equal_to",
                        "in": "query",
                        "description": "Filter tasks by exact match",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Filter tasks by specific date",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_between",
                        "in": "query",
                        "description": "Filter tasks by date range",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_between",
                        "in": "query",
                        "description": "Filter tasks by value range",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_greater_than",
                        "in": "query",
                        "description": "Filter tasks by date greater than",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_less_than",
                        "in": "query",
                        "description": "Filter tasks by date less than",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead tasks retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task/{id}": {
            "get": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get a specific lead task by ID",
                "operationId": "30fcd3897b9906754016b05b1a86b8bd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead task to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead task retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_task": {
                                            "type": "object"
                                        },
                                        "smsPhoneNumberCount": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Update a specific lead task",
                "operationId": "02005b9532be736d534d21dbc92217a9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead task to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the task",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Follow up call"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Call the lead to discuss the proposal"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the task to",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "lead_task_status_id",
                        "in": "query",
                        "description": "Status ID of the task",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "due_date_time",
                        "in": "query",
                        "description": "Due date and time for the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 12:00:00"
                        }
                    },
                    {
                        "name": "remainder_time",
                        "in": "query",
                        "description": "Reminder date and time for the task",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 10:00:00"
                        }
                    },
                    {
                        "name": "set_remainder",
                        "in": "query",
                        "description": "Type of reminder to set (sms_email, sms, email, none)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "email",
                            "enum": [
                                "sms_email",
                                "sms",
                                "email",
                                "none"
                            ]
                        }
                    },
                    {
                        "name": "activity",
                        "in": "query",
                        "description": "Type of activity (followup, appointment, call, todo, none)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "call",
                            "enum": [
                                "followup",
                                "appointment",
                                "call",
                                "todo",
                                "none"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead task updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead-task Updated Successfully"
                                        },
                                        "lead_task": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Delete a specific lead task",
                "operationId": "cfa57815610024da2f8ea94ffe7da62b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead task to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead task deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "LeadTask Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task/task-status-list": {
            "get": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get a list of all lead task statuses",
                "operationId": "0d75c2bebf73f7057f2a935cc89f7cba",
                "responses": {
                    "200": {
                        "description": "Lead task statuses retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_task_status": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead task statuses not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/upcoming-reminder-lead-task-count": {
            "get": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get count of upcoming reminder lead tasks",
                "operationId": "eefc9e261eccb6975347c8f3e621d3f2",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering tasks",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-01 00:00:00"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering tasks",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-01-31 23:59:59"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to filter tasks by assignee",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "count": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-task/get-last-7-days-leads-notifications": {
            "get": {
                "tags": [
                    "Lead Tasks"
                ],
                "summary": "Get lead task notifications for the next 7 days",
                "operationId": "ae6d01263f35719ddafdf7adb85ad9ea",
                "responses": {
                    "200": {
                        "description": "Lead task notifications retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leadTasks": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "assigned_to_member": {
                                                        "type": "string",
                                                        "example": "John Doe"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "Jane"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Smith"
                                                    },
                                                    "task_status": {
                                                        "type": "string",
                                                        "example": "Pending"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-task-to-selected-leads": {
            "post": {
                "tags": [
                    "Lead Task"
                ],
                "summary": "Create the same LeadTask against multiple leads in one call",
                "description": "Iterates `lead_id[]` and creates a LeadTask row per entry using the supplied title/activity/reminder settings. Date fields are converted from the user's timezone to UTC before persistence.",
                "operationId": "leadTaskAddToSelectedLeads",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "lead_id",
                                    "title"
                                ],
                                "properties": {
                                    "lead_id": {
                                        "description": "One or more Lead IDs to add the task against",
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "example": 123
                                        }
                                    },
                                    "title": {
                                        "description": "Auto-converted to ucwords()",
                                        "type": "string",
                                        "example": "Send proposal"
                                    },
                                    "activity": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "followup",
                                            "appointment",
                                            "call",
                                            "todo",
                                            "none"
                                        ]
                                    },
                                    "set_remainder": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "sms_email",
                                            "sms",
                                            "email",
                                            "none"
                                        ]
                                    },
                                    "remainder_time": {
                                        "description": "Local time; server converts to UTC",
                                        "type": "string",
                                        "format": "date-time",
                                        "nullable": true
                                    },
                                    "due_date_time": {
                                        "description": "Local time; server converts to UTC",
                                        "type": "string",
                                        "format": "date-time",
                                        "nullable": true
                                    },
                                    "assigned_to": {
                                        "description": "If set, triggers an in-app notification to that user",
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Tasks created (success) — OR exception caught (success=false, no separate status code)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead task added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-upload-links": {
            "post": {
                "tags": [
                    "Lead Upload Links"
                ],
                "summary": "Create (or reuse) a shareable upload link for a lead",
                "description": "Requires the \"add files to leads\" permission. When the lead already has an active link, that link is returned instead of creating a second one.",
                "operationId": "9fca76ac73ca4d31d6898057b7d6f18f",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "lead_id"
                                ],
                                "properties": {
                                    "lead_id": {
                                        "type": "integer",
                                        "example": 1956452
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The active upload link for the lead (existing or newly created)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LeadUploadLinkPayload"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Missing the \"add files to leads\" permission",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthorized"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed ({success, message, errors}) or lead not found ({message})",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "nullable": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead Not Found"
                                        },
                                        "errors": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-upload-links/lead/{leadId}": {
            "get": {
                "tags": [
                    "Lead Upload Links"
                ],
                "summary": "Get the lead's active upload link, if any",
                "description": "Requires the \"read files in leads\" permission. Returns the most recent link that is neither revoked nor expired.",
                "operationId": "d4b6660840c267de55f7e47827c2f9f1",
                "parameters": [
                    {
                        "name": "leadId",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The active link, or null when the lead has none",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "link": {
                                            "nullable": true,
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/LeadUploadLinkPayload"
                                                }
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Missing the \"read files in leads\" permission",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthorized"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-upload-links/{id}": {
            "delete": {
                "tags": [
                    "Lead Upload Links"
                ],
                "summary": "Revoke an upload link",
                "description": "Requires the \"delete files from leads\" permission. The link is revoked (soft), not deleted — the public endpoints treat it as expired from then on.",
                "operationId": "623eafadffc9e2aaf0b86840396eae17",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Upload link ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Link revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Upload Link Revoked Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Missing the \"delete files from leads\" permission",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthorized"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Upload link not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Upload Link Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-upload-links/public/{token}": {
            "get": {
                "tags": [
                    "Lead Upload Links"
                ],
                "summary": "Guest view of an upload link (public)",
                "description": "Unauthenticated. Returns the branding details the guest upload page shows. Revoked or expired links answer 404.",
                "operationId": "42793224cd87f8e7f97b5f8992de534a",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "description": "Upload link token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Link details for the guest page",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "lead_title": {
                                            "type": "string",
                                            "example": "Website redesign enquiry"
                                        },
                                        "client_name": {
                                            "type": "string",
                                            "example": "Telsa Media",
                                            "nullable": true
                                        },
                                        "client_logo": {
                                            "description": "Client logo URL (a placeholder image when the client has no logo)",
                                            "type": "string",
                                            "format": "url"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Link invalid, revoked or expired",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "This link is invalid or has expired."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/lead-upload-links/public/{token}/upload": {
            "post": {
                "tags": [
                    "Lead Upload Links"
                ],
                "summary": "Guest file upload through a shareable link (public)",
                "description": "Unauthenticated. Stores the files against the link's lead, logs one activity entry for the whole batch (attributed to whoever generated the link, falling back to the lead's assignee) and notifies the lead's assignee.",
                "operationId": "9cf11348b1876ac80fe106eb1482b9ce",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "description": "Upload link token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "description": "Up to 5 files, each max 10 MB; allowed types: jpg, jpeg, png, pdf, doc, docx, xls, xlsx, csv, zip",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Files stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Files uploaded successfully"
                                        },
                                        "uploaded": {
                                            "description": "Number of files stored",
                                            "type": "integer",
                                            "example": 3
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Link invalid, revoked or expired",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "This link is invalid or has expired."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed (too many files, file too large, or unsupported type)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Validation failed"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/leave": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get all leaves",
                "operationId": "74d1d72f712385b8423162d4fb4a17cc",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Create a new leave application or assign leave to another user",
                "operationId": "01b08ba6e12337cdca9793bedf6ea2d8",
                "parameters": [
                    {
                        "name": "leave_type_id",
                        "in": "query",
                        "description": "Leave type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date of leave (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date of leave (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "description": "Reason for leave",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID (required when assigning leave to another user)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "hours",
                        "in": "query",
                        "description": "Hours (for partial day leave)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave application created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave added successfully."
                                        },
                                        "data": {
                                            "properties": {
                                                "leave_id": {
                                                    "type": "integer",
                                                    "example": 123
                                                },
                                                "total_days": {
                                                    "type": "number",
                                                    "example": 2
                                                },
                                                "remaining_balance": {
                                                    "type": "number",
                                                    "example": 18
                                                },
                                                "is_assignment": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "pending"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/data-table": {
            "post": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get leaves data for datatable",
                "operationId": "f0da6dbe32fb2eda255a3b48875cd5c4",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by start date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by end date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "leave_type_id",
                        "in": "query",
                        "description": "Filter by leave type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leaves data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/month-wise": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get month-wise leaves for calendar view",
                "operationId": "11fbd0102807f5a56790613ef0dd30e4",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID (admin only)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering leaves (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-06-01"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering leaves (Y-m-d format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-06-30"
                        }
                    },
                    {
                        "name": "leave_type_id",
                        "in": "query",
                        "description": "Filter by leave type ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leaves retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2638
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "leave_type_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "example": "2025-06-05"
                                                    },
                                                    "end_date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "example": "2025-06-06"
                                                    },
                                                    "total_hours": {
                                                        "type": "string",
                                                        "example": "16.00"
                                                    },
                                                    "total_days": {
                                                        "type": "string",
                                                        "example": "2.00"
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 2397
                                                    },
                                                    "reason": {
                                                        "type": "string",
                                                        "example": "going out with parents"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "pending"
                                                    },
                                                    "created_by": {
                                                        "type": "integer",
                                                        "example": 2397
                                                    },
                                                    "checked_by": {
                                                        "type": "integer",
                                                        "example": null
                                                    },
                                                    "checked_at": {
                                                        "type": "string",
                                                        "example": null
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "deleted_at": {
                                                        "type": "string",
                                                        "example": null
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "Arpan"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "C"
                                                    },
                                                    "applicant_name": {
                                                        "type": "string",
                                                        "example": "Arpan C"
                                                    },
                                                    "profile_img": {
                                                        "type": "string",
                                                        "example": "https://telagus-crm-bucket.s3.eu-west-2.amazonaws.com/app/public/avatar.png"
                                                    },
                                                    "leave_type_data": {
                                                        "properties": {
                                                            "leave_type_title": {
                                                                "type": "string",
                                                                "example": "Normal Leave"
                                                            },
                                                            "leave_type_color": {
                                                                "type": "string",
                                                                "example": "#83c340"
                                                            }
                                                        },
                                                        "type": "object"
                                                    },
                                                    "allow_update": {
                                                        "type": "boolean",
                                                        "example": false
                                                    },
                                                    "leave_total_day": {
                                                        "type": "integer",
                                                        "example": 2
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/{id}": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get details of a specific leave application",
                "operationId": "7b9d2e28f42d1898eacf9620d1ca2ea8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Leave application ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Update the status of a leave application",
                "operationId": "5fe7929a9ffd05f5b73aacd9b177fd87",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Leave application ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "New status (approved, rejected, canceled)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "approved",
                                "rejected",
                                "canceled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave Approved successfully."
                                        },
                                        "leave": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Delete a leave application",
                "operationId": "6507c5e93195b35b4d756a920b01110c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Leave application ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/update-leave-info": {
            "post": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Update leave application information",
                "operationId": "866acd99f301607387657eff0df03686",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "leave_id",
                        "in": "query",
                        "description": "Leave application ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "total_days",
                        "in": "query",
                        "description": "Total days of leave",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "leave_type_id",
                        "in": "query",
                        "description": "Leave type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date of leave (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date of leave (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "description": "Reason for leave",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Leave status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved",
                                "rejected",
                                "canceled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave information updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave Updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave-by-user/{id}": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get all leave applications for a specific user",
                "operationId": "264ff23c9a2e2520fd84f1ed17069d0c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User's leaves retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leaves not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user-leave/{id}": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get leave statistics for a specific user",
                "operationId": "f291ea1fc39448e5d090cbe303b5d924",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User's leave statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "total_pending_leaves_for_approval": {
                                                    "type": "integer"
                                                },
                                                "total_applyed_leaves": {
                                                    "type": "integer"
                                                },
                                                "total_remaining_leave_to_apply": {
                                                    "type": "integer"
                                                },
                                                "total_leaves": {
                                                    "type": "integer"
                                                },
                                                "festival_leave": {
                                                    "type": "integer"
                                                },
                                                "normal_leave": {
                                                    "type": "integer"
                                                },
                                                "total_approved_leave": {
                                                    "type": "integer"
                                                },
                                                "remaning_leaves": {
                                                    "type": "integer"
                                                },
                                                "approval_pending": {
                                                    "type": "integer"
                                                },
                                                "balance_leave": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave data not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-upcoming-week-leaves": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get all leave applications for the upcoming week",
                "operationId": "2c976a84f2adadaf2fa0ff8141aadd05",
                "responses": {
                    "200": {
                        "description": "Upcoming week leaves retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "sdate": {
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "edate": {
                                            "type": "string",
                                            "format": "date"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-today-on-leaves": {
            "get": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get all leave applications for today",
                "operationId": "f32228546752c77a811b5ff533a6a798",
                "responses": {
                    "200": {
                        "description": "Today's leaves retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaves": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/user-leave-statistics": {
            "post": {
                "tags": [
                    "Leaves"
                ],
                "summary": "Get leave statistics for a user within a date range",
                "operationId": "879ed11fe9b46cbf43e8f4aea2c8e10a",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID (defaults to authenticated user)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date (defaults to January 1st of current year)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "todate",
                        "in": "query",
                        "description": "End date (defaults to December 31st of current year)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave statistics retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "leaveByType": {
                                            "type": "object"
                                        },
                                        "user_data": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "chart_date": {
                                            "type": "object"
                                        },
                                        "typeWiseData": {
                                            "type": "object"
                                        },
                                        "yearStart": {
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "yearEnd": {
                                            "type": "string",
                                            "format": "date"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave data not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave/unapplied-absences": {
            "get": {
                "tags": [
                    "Leave"
                ],
                "summary": "List employee absence days that have no leave application filed",
                "description": "Scans attendance vs. festival/holiday calendars from the start of the current year through today, with a 2-working-day grace window, and returns absences that no LeaveApplication accounts for. Optional client_id / user_id query params narrow the scope.",
                "operationId": "leaveGetUnappliedAbsences",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Limit to a single client",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Limit to a single user",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Unapplied-absence rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave-type": {
            "get": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Get all leave types",
                "operationId": "0af66e2be9ade82de5db420e3869640b",
                "responses": {
                    "200": {
                        "description": "List of all leave types",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "leave-type": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Create a new leave type",
                "operationId": "11d759ac692b34b81aace2f1d4971c20",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "description"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Sick Leave"
                                    },
                                    "description": {
                                        "type": "string",
                                        "example": "Leave for medical reasons"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Leave type created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave type created successfully."
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave-type/data-table": {
            "post": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Get leave types for datatable",
                "operationId": "146d60644038308b093adefec283e17b",
                "responses": {
                    "200": {
                        "description": "Leave types data for datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/leave-type/{id}": {
            "get": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Get a specific leave type",
                "operationId": "5434594cb67d14e9109e3fa497e58245",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the leave type",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave type details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Update an existing leave type",
                "operationId": "7aa699bfccc580c412995a9d2aacaaf3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the leave type to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title",
                                    "description"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "example": "Annual Leave"
                                    },
                                    "description": {
                                        "type": "string",
                                        "example": "Regular vacation leave"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Leave type updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Leave type updated successfully."
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave type not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Leave Types"
                ],
                "summary": "Delete a leave type",
                "operationId": "d9a26b65a0d38497b0e5029f79e484fa",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the leave type to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave type deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Leave type deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Leave type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/letter": {
            "get": {
                "tags": [
                    "Letters"
                ],
                "summary": "Get all letters for the authenticated user's client",
                "operationId": "be764996873c15861d3693acfb2475e7",
                "responses": {
                    "200": {
                        "description": "List of letters retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "letter": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Letters"
                ],
                "summary": "Create a new letter",
                "operationId": "964023074a7b65c9841945711335d7ac",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Letter title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Important Notice"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Letter content/description in HTML format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "<p>This is the content of the letter</p>"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Letter created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Letter Added Successfully"
                                        },
                                        "letter": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/letter/{id}": {
            "get": {
                "tags": [
                    "Letters"
                ],
                "summary": "Get a specific letter by ID",
                "operationId": "42ec45cbe8cc53778cf74533dab98707",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Letter ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Letter retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "letter": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Letter not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Letters"
                ],
                "summary": "Update an existing letter",
                "operationId": "2196797e39eb7f04eb84ecc118dc35f1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Letter ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Letter title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Letter Title"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Letter content/description in HTML format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "<p>Updated content of the letter</p>"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Letter updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Letter Updated Successfully"
                                        },
                                        "letter": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Letter not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Letters"
                ],
                "summary": "Delete a letter",
                "operationId": "9c89a540d02f6332ba9e60eae2636743",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Letter ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Letter deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Letter Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Letter not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Letter Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-pdf/{id}": {
            "get": {
                "tags": [
                    "Letters"
                ],
                "summary": "Generate PDF from letter HTML content",
                "operationId": "1d860a73039f35a175d90430a4b2af07",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Letter ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file generated successfully",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Letter not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/print-contact-information/{id}": {
            "get": {
                "tags": [
                    "Letters"
                ],
                "summary": "Generate PDF with contact information for a lead",
                "operationId": "7a297a8b76389f4dfdfa8560e003beed",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF with contact information generated successfully",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Lead not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/data-table/get": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get marketplace data for datatable",
                "operationId": "4fb807309ae8747f57ccbe9bcf89f219",
                "responses": {
                    "200": {
                        "description": "Marketplace data retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/get/{slug}": {
            "get": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get marketplace integrations for the current client by platform slug",
                "description": "Returns every Marketplace row for the authenticated user's client where `platform` matches the slug (e.g. shopify, woocommerce).",
                "operationId": "getFrameworkDataBySlug",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Platform slug filter, matched against Marketplace.platform",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "shopify"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Marketplace rows matching the slug",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No marketplace rows for this client/slug",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace": {
            "get": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get all marketplace integrations",
                "operationId": "49e4a0f0f79e5e96515eda469ffeadbd",
                "responses": {
                    "200": {
                        "description": "List of marketplace integrations",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Data not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Create a new marketplace integration",
                "operationId": "94a1856ee276d4a2b69b4cf99f40c7ca",
                "parameters": [
                    {
                        "name": "platform",
                        "in": "query",
                        "description": "Platform type (magento2, shopify, wordpress)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "magento2",
                                "shopify",
                                "wordpress"
                            ]
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "description": "Store URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Access token (required for magento2 and shopify)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "consumerKey",
                        "in": "query",
                        "description": "Consumer key (required for wordpress)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "consumerSecret",
                        "in": "query",
                        "description": "Consumer secret (required for wordpress)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "username",
                        "in": "query",
                        "description": "Username",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Password",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Integration title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_token_expiry_check",
                        "in": "query",
                        "description": "Whether to check token expiry",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Record created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Record has been created successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/{id}": {
            "get": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get specific marketplace integration",
                "operationId": "ff61715cbe1adff30aafbac15a58dd23",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Marketplace integration ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Marketplace integration details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Data not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Update an existing marketplace integration",
                "operationId": "b9bc7eb6a85a27c065584c444f30fb11",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Marketplace integration ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "platform",
                        "in": "query",
                        "description": "Platform type (magento2, shopify, wordpress)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "magento2",
                                "shopify",
                                "wordpress"
                            ]
                        }
                    },
                    {
                        "name": "url",
                        "in": "query",
                        "description": "Store URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Access token (required for magento2 and shopify)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "consumerKey",
                        "in": "query",
                        "description": "Consumer key (required for wordpress)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "consumerSecret",
                        "in": "query",
                        "description": "Consumer secret (required for wordpress)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Record updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Record has been updated successfully!"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Record not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Delete a marketplace integration",
                "operationId": "20565e9ec707bd4aba72a775f4180cc9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Marketplace integration ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Record deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Record has been Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Record Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-currency": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify currency information",
                "operationId": "1659686bffa99c4a5a6d5896b31fb3e6",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_at_min",
                        "in": "query",
                        "description": "Filter by minimum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_at_max",
                        "in": "query",
                        "description": "Filter by maximum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Shopify API response successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Shopify API response successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong with api"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-one-order": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify order information",
                "operationId": "56d7a04bd1c8051bbff8da8aeb368145",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_at_min",
                        "in": "query",
                        "description": "Filter by minimum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_at_max",
                        "in": "query",
                        "description": "Filter by maximum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Shopify API response successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Shopify API response successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong with api"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-customer-count": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify customer count",
                "operationId": "09c905fc2e43ea29402080129571fda1",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_at_min",
                        "in": "query",
                        "description": "Filter by minimum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_at_max",
                        "in": "query",
                        "description": "Filter by maximum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Shopify API response successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Shopify API response successful."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong with api"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-order-count": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify order count",
                "operationId": "2a4db7563c75930717c094dc6c2b2eb5",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_at_min",
                        "in": "query",
                        "description": "Filter by minimum creation date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_at_max",
                        "in": "query",
                        "description": "Filter by maximum creation date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Shopify count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Shopify count got."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-customers": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify customers",
                "operationId": "a39b46a535b9a58878934ef2f92c67e1",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records to return",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_info",
                        "in": "query",
                        "description": "Pagination information",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Customers fetched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "headers": {
                                            "type": "object"
                                        },
                                        "url": {
                                            "type": "string"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Customer fetched."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong with customer"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/shopify-order": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get Shopify orders",
                "operationId": "09c24af4ccafba80340d52f9f37f1396",
                "parameters": [
                    {
                        "name": "apiUrl",
                        "in": "query",
                        "description": "Shopify API URL",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Shopify access token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of records to return",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_info",
                        "in": "query",
                        "description": "Pagination information",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_at_min",
                        "in": "query",
                        "description": "Filter by minimum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "created_at_max",
                        "in": "query",
                        "description": "Filter by maximum creation date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Shopify orders retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "headers": {
                                            "type": "object"
                                        },
                                        "query": {
                                            "type": "string"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Shopify connected."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Something wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-ecommerce-market-place-by-client-id/{client_id}": {
            "get": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Get marketplace integrations by client ID",
                "operationId": "01eb780a426840d5793cf03cacab3b1a",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Marketplace integrations retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Record not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ecommerce-marketplace/cronUpdate": {
            "post": {
                "tags": [
                    "Marketplace"
                ],
                "summary": "Update cron status for a marketplace integration",
                "operationId": "cd8d2e1eb16c7f4616f2b3682555b11d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Marketplace integration ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cron status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Cron Status Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Record Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/metered-billing-prices": {
            "get": {
                "tags": [
                    "Metered Billing Prices"
                ],
                "summary": "Get all metered billing prices",
                "operationId": "44177a804b338f0554bd12ade25d59b1",
                "responses": {
                    "200": {
                        "description": "Metered billing prices retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-milestone": {
            "get": {
                "tags": [
                    "Project Milestone"
                ],
                "summary": "List project milestones (resource index – placeholder, not currently implemented)",
                "operationId": "17c9bd11020344d288f021eb0ad88c1e",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Milestones"
                ],
                "summary": "Create a new project milestone",
                "operationId": "067e872e146e6b160b6dfce85000147d",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Milestone title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Phase 1 Completion"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Milestone description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Complete all initial requirements"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date for the milestone",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Milestone created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Milestone Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-milestone/{id}": {
            "get": {
                "tags": [
                    "Project Milestones"
                ],
                "summary": "Get specific project milestone by ID",
                "operationId": "256ab1254e56d1f31728c70c782bca5e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Milestone ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "milestone": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Milestone not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Project Milestones"
                ],
                "summary": "Update an existing project milestone",
                "operationId": "b4efedf6074c1fd2b86ef4af2b50f0fb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Milestone ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Milestone title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Phase 1 Completion"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Milestone description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated description for milestone"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date for the milestone",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2023-12-31"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Milestone updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Milestone Updated Successfully"
                                        },
                                        "project": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Milestone not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Milestones"
                ],
                "summary": "Delete a project milestone",
                "operationId": "e50fd12aa28ff9495d6568254cd8de23",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Milestone ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Milestone deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Milestone Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Milestone not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-milestone/data-table/{id}": {
            "post": {
                "tags": [
                    "Project Milestones"
                ],
                "summary": "Get project milestones for datatable",
                "operationId": "bd0fd8f3661543eae4027e9a7690dc34",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Order parameter for datatable",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms-service": {
            "get": {
                "tags": [
                    "MMS"
                ],
                "summary": "List all MMS resources",
                "operationId": "727bb8a70e94604bfde4de5a27089a97",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Store a newly created MMS resource",
                "operationId": "cca45ef7b2766e784cce6c7894d46cda",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the MMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "My MMS"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Media file to upload (max 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the MMS",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "This is my MMS description"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Media type (audio or video)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "audio",
                            "enum": [
                                "audio",
                                "video"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "video_tytpe",
                        "in": "query",
                        "description": "Video type (youtube if applicable)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "youtube",
                            "enum": [
                                "youtube"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "plan": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Media uploaded successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms-service/{id}": {
            "get": {
                "tags": [
                    "MMS"
                ],
                "summary": "Display the specified MMS resource",
                "operationId": "295c290db7db6b7cac9abd5857e31f30",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the MMS to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "mediaData": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "MMS not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "MMS"
                ],
                "summary": "Update the specified MMS resource",
                "operationId": "72a0e39348765ef0f0f5c9a2b0c36d50",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the MMS to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the MMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated MMS Title"
                        }
                    },
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the MMS",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Updated MMS description"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Mms updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "MMS not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Data not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "MMS"
                ],
                "summary": "Remove the specified MMS resource",
                "operationId": "a946253f5d7178cae5f024b82aada759",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the MMS to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "MMS Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "MMS not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "MMS Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-media": {
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Get media based on type",
                "operationId": "bdab75937cbd452800d0acec719b204c",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Type of media to retrieve (audio or video)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "audio",
                            "enum": [
                                "audio",
                                "video"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Media retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "mediaData": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "fromNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms/send": {
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Send an MMS to a contact",
                "operationId": "d8f42055e594e10807c928283c9c1495",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead to send MMS to",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "Media file to send (max 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description or message text",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Check out this media",
                            "maxLength": 400
                        }
                    },
                    {
                        "name": "mobile",
                        "in": "query",
                        "description": "Mobile number to send to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the MMS",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "Important Media"
                        }
                    },
                    {
                        "name": "from_mobile",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "media_type",
                        "in": "query",
                        "description": "Type of media (audio or video)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "audio",
                            "enum": [
                                "audio",
                                "video"
                            ]
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Media has been sent to the contact."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms/get-available-credits": {
            "get": {
                "tags": [
                    "MMS"
                ],
                "summary": "Get available MMS credits for the authenticated user",
                "operationId": "e8602a3b4fa4ad04f52140dfa8b98b7c",
                "responses": {
                    "200": {
                        "description": "Credits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "credits_available": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "fromPhoneNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms/data-table/get": {
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Get MMS data for datatable",
                "operationId": "f8a436d7e357071ad804b9e5826b630f",
                "responses": {
                    "200": {
                        "description": "Data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "datatableResponse": {
                                            "type": "object"
                                        },
                                        "fromPhoneNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "sms_credits": {
                                            "type": "integer",
                                            "example": 100
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mms-report/{id}": {
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Get report for a specific MMS",
                "operationId": "9ff750a7135bd79813ce1ada28d7c384",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the MMS to get report for",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No results found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No search results found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-voice-drop-mms": {
            "post": {
                "tags": [
                    "MMS"
                ],
                "summary": "Send a voice drop MMS to a contact",
                "operationId": "812a8bca0f3e9b23e27d8c8fe66c95b9",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead to send MMS to",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890",
                            "maxLength": 20
                        }
                    },
                    {
                        "name": "mms_id",
                        "in": "query",
                        "description": "ID of the MMS to send",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "MMS sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Media has been sent to the contact."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong.!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-invoice": {
            "get": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Get list of monthly invoices for authenticated user",
                "operationId": "e2068d57a55725df6894c4255ec4dac8",
                "responses": {
                    "200": {
                        "description": "List of monthly invoices",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "invoice"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "No invoice found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Create a new monthly invoice",
                "operationId": "ae7c86658fac8c400d51d9c99f7236aa",
                "parameters": [
                    {
                        "name": "work",
                        "in": "query",
                        "description": "Work description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 30
                        }
                    },
                    {
                        "name": "amount",
                        "in": "query",
                        "description": "Invoice amount",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 6
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "duration",
                        "in": "query",
                        "description": "Duration",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bill_date",
                        "in": "query",
                        "description": "Bill date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (Y-m-d), must be after or equal to bill_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "last_email_sent_date",
                        "in": "query",
                        "description": "Last email sent date (Y-m-d), must be after or equal to bill_date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice added successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-invoice/data-table": {
            "post": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Get monthly invoices data for datatables",
                "operationId": "0207965e8d08342d4d049158f69464d8",
                "responses": {
                    "200": {
                        "description": "Monthly invoices data for datatables",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-invoice/{id}": {
            "get": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Get a specific monthly invoice",
                "operationId": "06bbe216ec461fe53a17074a5d09d782",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Monthly invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Monthly invoice details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Invoice not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Update a specific monthly invoice",
                "operationId": "82ef21a299d33d940dbeef286083e506",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Monthly invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "work",
                        "in": "query",
                        "description": "Work description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 30
                        }
                    },
                    {
                        "name": "amount",
                        "in": "query",
                        "description": "Invoice amount",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 6
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "duration",
                        "in": "query",
                        "description": "Duration",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bill_date",
                        "in": "query",
                        "description": "Bill date (Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (Y-m-d), must be after or equal to bill_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "last_email_sent_date",
                        "in": "query",
                        "description": "Last email sent date (Y-m-d), must be after or equal to bill_date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Updated Successfully."
                                        },
                                        "invoice": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Invoice not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Delete a specific monthly invoice",
                "operationId": "566b174871839eaa8150dfb01289435a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Monthly invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Invoice not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-invoice-pdf/{id}": {
            "get": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Generate PDF for a specific monthly invoice",
                "operationId": "97a755b5c5df1331a6914cf9dd8a37ad",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Monthly invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PDF file",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Invoice not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/monthly-invoice-mail/{id}": {
            "put": {
                "tags": [
                    "Monthly Invoice"
                ],
                "summary": "Send invoice by email",
                "operationId": "793fc4a5f99e85a481f58bd169b31106",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Monthly invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Email recipient",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "description": "CC recipients",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bcc",
                        "in": "query",
                        "description": "BCC recipients",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice sent Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Invoice not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Email sending failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/no-of-employees-options": {
            "get": {
                "tags": [
                    "Employee Settings"
                ],
                "summary": "Get number of employee settings",
                "operationId": "264c15a5a1ff2bb5dbf2eed8e71c70ea",
                "responses": {
                    "200": {
                        "description": "Settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "settings": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "lead_positions": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Employee Settings"
                ],
                "summary": "Save number of employee settings",
                "operationId": "2604f8b81be7f8104edf9c3a11cae83c",
                "parameters": [
                    {
                        "name": "settings",
                        "in": "query",
                        "description": "Array of employee settings",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "1-10"
                                    },
                                    "visibility_position_wise": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "sort": {
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/no-of-employees-options/{id}": {
            "put": {
                "tags": [
                    "Employee Settings"
                ],
                "summary": "Update number of employee setting",
                "operationId": "b86384a0ec51a2c2d9a40023a68575b3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the employee setting to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the employee setting",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1-10"
                        }
                    },
                    {
                        "name": "visibility_position_wise",
                        "in": "query",
                        "description": "Visibility settings for different positions",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Setting not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notes": {
            "get": {
                "tags": [
                    "Notes"
                ],
                "summary": "Get a list of all notes",
                "operationId": "1dc6cbbddca59398445a4629cc524db1",
                "responses": {
                    "200": {
                        "description": "List of notes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Notes"
                ],
                "summary": "Create a new note",
                "operationId": "1d2f133e028e4f92114ff265422b262f",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the note",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Meeting Notes"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Content of the note",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Discussed project timeline and deliverables"
                        }
                    },
                    {
                        "name": "important",
                        "in": "query",
                        "description": "Flag to mark note as important",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the associated lead",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Notes Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notes/data-table/get": {
            "post": {
                "tags": [
                    "Notes"
                ],
                "summary": "Get notes data for datatables",
                "operationId": "c620a93ccfc94292e53089c683185c11",
                "responses": {
                    "200": {
                        "description": "Notes data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notes/{id}": {
            "get": {
                "tags": [
                    "Notes"
                ],
                "summary": "Get a specific note by ID",
                "operationId": "79fda49835a377aff2f6a09c6d29d92e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the note to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "notes": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Note not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "notes": {
                                            "type": "string",
                                            "example": "No Notes Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Notes"
                ],
                "summary": "Update a specific note",
                "operationId": "26bd94d8620c2cd0eb502c5b8926e1a7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the note to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Updated title of the note",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Meeting Notes"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Updated content of the note",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated project timeline and deliverables"
                        }
                    },
                    {
                        "name": "important",
                        "in": "query",
                        "description": "Flag to mark note as important",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Notes Updated Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Note not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Notes Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Notes"
                ],
                "summary": "Delete a specific note",
                "operationId": "65a8529f109b415ac9a929f7fb9e02cc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the note to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Notes Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Note not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Notes Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/note-search": {
            "post": {
                "tags": [
                    "Notes"
                ],
                "summary": "Search for notes by title",
                "operationId": "e55cd49cffa4efea23a975067957295b",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Search term to find in note titles",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Meeting"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Search"
                                        },
                                        "notes": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No search results found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No search results found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-note-to-selected-leads": {
            "post": {
                "tags": [
                    "Notes"
                ],
                "summary": "Add the same note to multiple selected leads in one call",
                "operationId": "f8f3b6c5e96b7e965f556cfadd7f224d",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "lead_id",
                                    "note"
                                ],
                                "properties": {
                                    "lead_id": {
                                        "description": "Array of lead IDs to attach the note to",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "note": {
                                        "description": "Note text to add to each lead",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Notes inserted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-important-note": {
            "post": {
                "tags": [
                    "Notes"
                ],
                "summary": "Add an important note (route declared but handler not yet implemented)",
                "operationId": "aadc94a4ed4e3ed2cfb9cbd6c73773ec",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notifications": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get a list of notifications",
                "operationId": "c253e861b8713c9da4f8ae35505d71bf",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Store a newly created notification",
                "operationId": "2ddff52751886862c960838b9aef996d",
                "responses": {
                    "200": {
                        "description": "Notification stored successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notifications/{id}": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get a specific notification",
                "operationId": "fe00059610eca333d527222bec6c93e1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the notification",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Notification not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-notificationsEs": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get all notifications for the authenticated user using Elasticsearch",
                "operationId": "ad1326b628a023039d811015e303e1e8",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "filterValue",
                        "in": "query",
                        "description": "Filter value for notifications",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "notifications": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "seen_notification": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "unseen_notification": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "unread": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "seenPages": {
                                            "type": "integer"
                                        },
                                        "unSeenPages": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Elasticsearch is down"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-notifications": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get all notifications for the authenticated user using database",
                "operationId": "8a0fbd96e872777c8a93cdc42d59a10b",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "filterValue",
                        "in": "query",
                        "description": "Filter value for notifications",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "notifications": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "seen_notification": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "unseen_notification": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "unread": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "seenPages": {
                                            "type": "integer"
                                        },
                                        "unSeenPages": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-leave-notifications": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get all leave notifications for the authenticated user",
                "operationId": "aa8c45e0d3d76aecf7e84da91e2fa0ea",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "notifications": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "readCount": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "leave_notifications_count": {
                                            "type": "integer"
                                        },
                                        "current_page": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/set-leave-notification-as-opened": {
            "put": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Mark a leave notification as opened",
                "operationId": "5829a7117eb75e6d4d75c6017696e831",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the notification",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification marked as opened successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Notification not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mark-all-as-unread": {
            "put": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Mark all notifications as unread for the authenticated user",
                "operationId": "a3f20fcf8c5b1266b2384cd9d96d4356",
                "responses": {
                    "200": {
                        "description": "All notifications marked as unread successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "totalUpdatedCount": {
                                            "type": "integer"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "All notifications has been marked as unread successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-notification": {
            "post": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Delete a specific notification for the authenticated user",
                "operationId": "963cbfa0162a10a09853d108e7b4cd54",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the notification to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notification has been cleared successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Notification not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notification not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-all-leave-notification": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Delete all leave notifications for the authenticated user",
                "operationId": "06718d4e496f6adb9853976d8dcdde2f",
                "responses": {
                    "200": {
                        "description": "All leave notifications deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "All leave notification has been cleared successfully."
                                        },
                                        "recodeIds": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/mark-all-as-read": {
            "put": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Mark all notifications as read for the authenticated user",
                "operationId": "680d7438373c5c943621a948d9bb3157",
                "responses": {
                    "200": {
                        "description": "All notifications marked as read successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "totalUpdatedCount": {
                                            "type": "integer"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "All notifications has been marked as read successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-all-notification": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Delete all non-leave notifications for the authenticated user",
                "operationId": "d1f55679443efd94fb28891e40cebe9e",
                "responses": {
                    "200": {
                        "description": "All notifications deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "All notification has been cleared successfully."
                                        },
                                        "recodeIds": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-notification-by-id/{id}": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get a specific notification by ID with full details",
                "operationId": "7ea709436a2692c3d433fae6a9e1955d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the notification",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Notification not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notification not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-leave-notification-by-id/{id}": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Get a specific leave notification by ID",
                "operationId": "b4724653982f0fcf4047e00773608fa5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the leave notification",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leave notification retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Notification not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notification not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notifications/{notification}": {
            "put": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Update the specified notification",
                "operationId": "39924e16a8c017afd220cec926fcb0b1",
                "parameters": [
                    {
                        "name": "notification",
                        "in": "path",
                        "description": "ID of the notification to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification updated successfully"
                    },
                    "404": {
                        "description": "Notification not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Delete the specified notification",
                "operationId": "a67b903f2f0f8c1251f3a0a1c86ac803",
                "parameters": [
                    {
                        "name": "notification",
                        "in": "path",
                        "description": "ID of the notification to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification deleted successfully"
                    },
                    "404": {
                        "description": "Notification not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding": {
            "get": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Get the onboarding wizard catalog and the client's progress",
                "description": "Returns the full active feature catalog grouped by wizard step, plus the client's onboarding record, selected feature IDs, and enabled modules. Read-only: never creates a record — clients who have never started onboarding get a transient default (id=null, status=pending, current_step=1).",
                "operationId": "7294cde68694f1f22949da13147b26e5",
                "responses": {
                    "200": {
                        "description": "Wizard catalog + client progress",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "steps": {
                                                    "description": "Catalog options grouped by wizard step",
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "step_group": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "industry",
                                                                    "role",
                                                                    "goals",
                                                                    "current_management",
                                                                    "team_size",
                                                                    "tools"
                                                                ]
                                                            },
                                                            "features": {
                                                                "type": "array",
                                                                "items": {
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "key": {
                                                                            "type": "string"
                                                                        },
                                                                        "name": {
                                                                            "type": "string"
                                                                        },
                                                                        "description": {
                                                                            "type": "string",
                                                                            "nullable": true
                                                                        },
                                                                        "step_group": {
                                                                            "type": "string"
                                                                        },
                                                                        "module_key": {
                                                                            "description": "Sidebar module key this option maps to (drives dashboard widget priority)",
                                                                            "type": "string",
                                                                            "nullable": true
                                                                        },
                                                                        "icon": {
                                                                            "type": "string",
                                                                            "nullable": true
                                                                        },
                                                                        "is_recommended": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "sort_order": {
                                                                            "type": "integer"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                }
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "onboarding": {
                                                    "description": "The client's onboarding record. id is null for clients who have never started (transient, un-saved default).",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer",
                                                            "nullable": true
                                                        },
                                                        "client_id": {
                                                            "type": "integer"
                                                        },
                                                        "status": {
                                                            "type": "string",
                                                            "enum": [
                                                                "pending",
                                                                "in_progress",
                                                                "completed",
                                                                "skipped"
                                                            ]
                                                        },
                                                        "current_step": {
                                                            "type": "integer",
                                                            "example": 1
                                                        },
                                                        "industry": {
                                                            "type": "string",
                                                            "nullable": true
                                                        },
                                                        "team_size": {
                                                            "type": "string",
                                                            "nullable": true
                                                        },
                                                        "extra": {
                                                            "description": "Free-form answers merged from saved steps",
                                                            "type": "object"
                                                        },
                                                        "onboarding_version": {
                                                            "type": "integer",
                                                            "example": 1
                                                        },
                                                        "completed_at": {
                                                            "type": "string",
                                                            "format": "date-time",
                                                            "nullable": true
                                                        },
                                                        "selected_feature_ids": {
                                                            "description": "IDs of all onboarding features the client has selected (across all steps)",
                                                            "type": "array",
                                                            "items": {
                                                                "type": "integer"
                                                            }
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "enabled_modules": {
                                                    "description": "Module keys selected during onboarding, intersected with the known sidebar modules",
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string",
                                                        "example": "crm-sales"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/status": {
            "get": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Get the client's onboarding status (route-guard check)",
                "description": "Lightweight, read-only status lookup. Never creates a record — status is null when the client has never started onboarding (e.g. accounts predating the feature), so the frontend route guard doesn't force existing users into the wizard.",
                "operationId": "36498286fa168b7cdb7a5faa184fa45f",
                "responses": {
                    "200": {
                        "description": "Onboarding status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "status": {
                                                    "description": "Null when the client has never started onboarding",
                                                    "type": "string",
                                                    "example": "in_progress",
                                                    "nullable": true,
                                                    "enum": [
                                                        "pending",
                                                        "in_progress",
                                                        "completed",
                                                        "skipped"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/step": {
            "post": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Save the selections for a single wizard step",
                "description": "Persists the feature selections for one wizard step (replacing that step's previous selections without touching other steps), sets status to in_progress, and advances current_step (never backwards — the max of the stored and submitted value is kept). Validated by SaveOnboardingStepRequest; the request is rejected with 403 when the authenticated user has no client_id.",
                "operationId": "71d81e197211e4e3bdaf34781d8cfe4e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "step",
                                    "feature_ids"
                                ],
                                "properties": {
                                    "step": {
                                        "description": "The wizard step being saved",
                                        "type": "string",
                                        "enum": [
                                            "industry",
                                            "role",
                                            "goals",
                                            "current_management",
                                            "team_size",
                                            "tools"
                                        ]
                                    },
                                    "feature_ids": {
                                        "description": "Selected onboarding feature IDs for this step (must exist in onboarding_features and not be soft-deleted). Send an empty array to clear the step.",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "extra": {
                                        "description": "Free-form answers merged into the record's extra column",
                                        "type": "object",
                                        "nullable": true
                                    },
                                    "current_step": {
                                        "description": "Wizard position to record; defaults to the step's own 1-based number when omitted",
                                        "type": "integer",
                                        "nullable": true,
                                        "maximum": 255,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Step saved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Onboarding step saved."
                                        },
                                        "data": {
                                            "description": "The updated onboarding record",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "in_progress"
                                                },
                                                "current_step": {
                                                    "type": "integer"
                                                },
                                                "industry": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "team_size": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "extra": {
                                                    "type": "object"
                                                },
                                                "onboarding_version": {
                                                    "type": "integer"
                                                },
                                                "completed_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Authenticated user has no client_id"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/progress": {
            "post": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Record the wizard position without saving selections",
                "description": "Persists the wizard position so a page reload resumes from the same step (used when a step is skipped, which saves no selections). Sets status to in_progress; current_step never moves backwards.",
                "operationId": "7de8dfdab4dd017c5d33ae335a26c0af",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "current_step"
                                ],
                                "properties": {
                                    "current_step": {
                                        "type": "integer",
                                        "example": 3,
                                        "maximum": 255,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Progress recorded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "description": "The updated onboarding record",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "in_progress"
                                                },
                                                "current_step": {
                                                    "type": "integer"
                                                },
                                                "industry": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "team_size": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "extra": {
                                                    "type": "object"
                                                },
                                                "onboarding_version": {
                                                    "type": "integer"
                                                },
                                                "completed_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/skip": {
            "post": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Skip onboarding entirely",
                "description": "Marks onboarding as skipped, stamps completed_at, writes ALL sidebar modules into choose_module (so every menu stays visible), and logs a single activity entry. No request body.",
                "operationId": "41ceeea3a3489a3fca51c361e71845ca",
                "responses": {
                    "200": {
                        "description": "Onboarding skipped",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Onboarding skipped."
                                        },
                                        "data": {
                                            "description": "The updated onboarding record",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "skipped"
                                                },
                                                "current_step": {
                                                    "type": "integer"
                                                },
                                                "industry": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "team_size": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "extra": {
                                                    "type": "object"
                                                },
                                                "onboarding_version": {
                                                    "type": "integer"
                                                },
                                                "completed_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/complete": {
            "post": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Finalise onboarding and apply the selected modules",
                "description": "Marks onboarding as completed, stamps completed_at, writes ALL sidebar modules into choose_module (selections only re-prioritise dashboard widgets, they never hide menus), and logs a single activity entry. No request body. Also returns the client's choose_module row and enabled modules for the frontend to apply immediately.",
                "operationId": "c8f43559458e4d2cf9113cf22cf2c154",
                "responses": {
                    "200": {
                        "description": "Onboarding completed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Onboarding completed."
                                        },
                                        "data": {
                                            "description": "The updated onboarding record",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "client_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "completed"
                                                },
                                                "current_step": {
                                                    "type": "integer"
                                                },
                                                "industry": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "team_size": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "extra": {
                                                    "type": "object"
                                                },
                                                "onboarding_version": {
                                                    "type": "integer"
                                                },
                                                "completed_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "choose_module_info": {
                                            "description": "The client's latest choose_module row (its response column is a JSON-encoded array of module keys)",
                                            "type": "object",
                                            "nullable": true
                                        },
                                        "enabled_modules": {
                                            "description": "Module keys selected during onboarding, intersected with the known sidebar modules",
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "crm-sales"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/onboarding/dashboard-widgets": {
            "get": {
                "tags": [
                    "Onboarding"
                ],
                "summary": "Get dashboard widget descriptors for the client's enabled modules",
                "description": "Maps the client's enabled modules (from onboarding selections carrying a module_key) through the server-side widget registry (config/onboarding.php → widgets). Returns an empty array when no modules are enabled.",
                "operationId": "f21a36bb2fd1313d347574829c180058",
                "responses": {
                    "200": {
                        "description": "Widget descriptors, in module priority order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "key": {
                                                        "description": "Dashboard widget key used by the Angular dynamic dashboard",
                                                        "type": "string",
                                                        "example": "todayStatistics"
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "Today's Statistics"
                                                    },
                                                    "size": {
                                                        "description": "full spans the row; half sits in a two-column layout",
                                                        "type": "string",
                                                        "enum": [
                                                            "full",
                                                            "half"
                                                        ]
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/orders": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Get all orders with their items",
                "operationId": "c02aa30f94291e4be52bbbf6370aff55",
                "responses": {
                    "200": {
                        "description": "List of all orders with their items",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "order_type": {
                                                "type": "string",
                                                "example": "plan"
                                            },
                                            "order_history": {
                                                "type": "string"
                                            },
                                            "orderItem": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Orders"
                ],
                "summary": "Store a newly created order",
                "operationId": "29fe167e28f1159282f58534e40288c0",
                "responses": {
                    "200": {
                        "description": "Order created successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-ind-order/{id}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Get a specific order by ID",
                "operationId": "3c79b5ed3d48475e3882a5c9386f4a03",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "order": {
                                            "type": "object"
                                        },
                                        "order_items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Order not found or not authorized to view",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "The order you're trying to view doesn't seem to be yours, hmmmm."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-active-subscription": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Check if the authenticated user's client has an active subscription",
                "operationId": "a5b7042a6ac173aee721502e84069541",
                "responses": {
                    "200": {
                        "description": "Subscription status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "subscribe": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "checkout": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "buy_plan": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "msg": {
                                            "type": "string",
                                            "example": "Subscription is active."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-active-plan": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Check if the authenticated user's client has an active plan",
                "operationId": "bddc12a7df55ef178b27235b1290063d",
                "responses": {
                    "200": {
                        "description": "Plan status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "order": {
                                            "description": "Order details if active",
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/unsubscribe-forever-free-email/{id}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Unsubscribe from forever free emails",
                "operationId": "49f7796a4fd0d33d9b18a4756d1088e7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to unsubscribe page or home page"
                    }
                }
            }
        },
        "/api/orders/data-table/get": {
            "post": {
                "tags": [
                    "Orders"
                ],
                "summary": "Get orders data for data table with pagination, sorting and filtering",
                "operationId": "2c7b8e7899e72e1edef7f0d6d10d6b67",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of items per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 10
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "description": "Field to sort by",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "created_at"
                        }
                    },
                    {
                        "name": "sort_dir",
                        "in": "query",
                        "description": "Sort direction (asc or desc)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "desc",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Orders data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "per_page": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "current_page": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "last_page": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-active-plan-limits": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Get combined limits from active plan and add-ons",
                "description": "Returns aggregated package item limits from all active orders (plan + add-ons). Limits are summed by package item type.",
                "operationId": "db5f27b8d2c2d9f591d999edabc059bd",
                "parameters": [
                    {
                        "name": "clientId",
                        "in": "query",
                        "description": "Client ID (optional, defaults to authenticated user's client)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Active plan and add-on limits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "client_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "package_items": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "description": "Package item ID",
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "name": {
                                                        "description": "Package item name",
                                                        "type": "string",
                                                        "example": "Team Members"
                                                    },
                                                    "slug": {
                                                        "description": "Package item slug",
                                                        "type": "string",
                                                        "example": "team-members"
                                                    },
                                                    "limit": {
                                                        "description": "Total combined limit from plan + add-ons",
                                                        "type": "integer",
                                                        "example": 7
                                                    },
                                                    "is_marketplace": {
                                                        "type": "boolean",
                                                        "example": false
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2026-01-01 00:00:00"
                                                    },
                                                    "end_date": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2026-02-01 00:00:00"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active plan or add-ons found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No active plan or add-ons found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/orders/{order}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Display the specified order with its items",
                "operationId": "32979ce4a314e82081173b33083b5c62",
                "parameters": [
                    {
                        "name": "order",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "order": {
                                            "type": "object"
                                        },
                                        "order_items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Order not found or not authorized to view"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Orders"
                ],
                "summary": "Update the specified order",
                "operationId": "7fda901af6c5e16e84229fcd8480f5a6",
                "parameters": [
                    {
                        "name": "order",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order updated successfully"
                    },
                    "404": {
                        "description": "Order not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Orders"
                ],
                "summary": "Delete the specified order",
                "operationId": "f9877620832096f16acb005b0a9681b5",
                "parameters": [
                    {
                        "name": "order",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Order deleted successfully"
                    },
                    "404": {
                        "description": "Order not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-active-plan-items/{clientId}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Get combined active plan and add-on package item limits for a client",
                "description": "Returns aggregated package item limits from all active orders (plan + add-ons) for the given client.",
                "operationId": "cb37baf467f596ccb8ee848a1996c6c6",
                "parameters": [
                    {
                        "name": "clientId",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Active plan and add-on limits retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "client_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "package_items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active plan or add-ons found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No active plan or add-ons found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-client-package-limit/{id}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Replicate and reset client package item limits for an order",
                "description": "Clones existing client_package_item_limits records for the given order, resets their dates to now, then deletes the originals.",
                "operationId": "81c7c4117933bfdd981ef40c0170861a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Order ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Client package limits updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/list": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Get list of messages from Outlook inbox organized by conversation threads (excluding unknown senders)",
                "operationId": "44da1fc2d7eda829a7b5ab83374c214c",
                "parameters": [
                    {
                        "name": "next_link",
                        "in": "query",
                        "description": "Next link for pagination",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "subject": {
                                                            "type": "string"
                                                        },
                                                        "conversation_id": {
                                                            "type": "string"
                                                        },
                                                        "from": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "is_read": {
                                                            "type": "boolean"
                                                        },
                                                        "date": {
                                                            "type": "string",
                                                            "format": "date-time"
                                                        },
                                                        "snippet": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            }
                                        },
                                        "is_end": {
                                            "type": "boolean"
                                        },
                                        "next_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error_description": {
                                            "type": "string"
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Get list of messages from Outlook inbox organized by conversation threads",
                "operationId": "477d6de258d65990d49d0a8ac1c8bf95",
                "parameters": [
                    {
                        "name": "next_link",
                        "in": "query",
                        "description": "Next link for pagination",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Messages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "is_end": {
                                            "type": "boolean"
                                        },
                                        "next_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error while connecting outlook"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/check-client": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Check if client is authenticated with Outlook",
                "operationId": "e2996a41f64f99f703e092c11cc9893c",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error_description": {
                                            "type": "string"
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/oauth2-callback": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Handle OAuth2 callback from Outlook",
                "operationId": "0606034d9a383d31287498d2eb9972ad",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Outlook",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token has been generated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/all-oauth2-callback": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Handle OAuth2 callback from Outlook for all users",
                "operationId": "7946c0fd7204de0d1c923ebeb94b2914",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Outlook",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token has been generated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/view": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "View a specific message from Outlook",
                "operationId": "fbd2e164fdd2ed377b4f7c18342cf347",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the message to view",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "string"
                                        },
                                        "subject": {
                                            "type": "string"
                                        },
                                        "from_name": {
                                            "type": "string"
                                        },
                                        "from_email": {
                                            "type": "string"
                                        },
                                        "reply_to": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "string"
                                        },
                                        "date": {
                                            "type": "string"
                                        },
                                        "attachments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "error_trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/download-attachment": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Download an attachment from an Outlook message",
                "operationId": "481ece67b2256ceaa23997284e2dde80",
                "parameters": [
                    {
                        "name": "message_id",
                        "in": "query",
                        "description": "ID of the message containing the attachment",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachment_id",
                        "in": "query",
                        "description": "ID of the attachment to download",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success - File download",
                        "content": {
                            "application/octet-stream": {}
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "error_trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/send": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Send an email through Outlook",
                "operationId": "0396d20c8e0dac1fba18b8377554596d",
                "parameters": [
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Email address of the recipient",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Subject of the email",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mail_body",
                        "in": "query",
                        "description": "Body of the email",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reply_to_mail_id",
                        "in": "query",
                        "description": "ID of the email to reply to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "append_signature",
                        "in": "query",
                        "description": "Whether to append signature to the email",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "file_names",
                        "in": "query",
                        "description": "Names of files to attach",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "description": "Email addresses for CC (comma-separated)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bcc",
                        "in": "query",
                        "description": "Email addresses for BCC (comma-separated)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead associated with this email",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Mail has been sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        },
                                        "error_trace": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/upload-attachment": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Upload an attachment for use in Outlook emails",
                "operationId": "b6fb092dde40c2d9a818d705d5bc5cba",
                "parameters": [
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload (max 25MB)",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File has been uploaded successfully"
                                        },
                                        "path": {
                                            "type": "string"
                                        },
                                        "file_name": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/logout": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Logout from Outlook",
                "operationId": "38df6952d1b30e36cb74de283393bfc5",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/leads-threads": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Get email threads related to a specific lead (excluding unknown senders)",
                "operationId": "65a4957b59a85b120e69aada0926b969",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_token",
                        "in": "query",
                        "description": "Page token for pagination",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "is_end": {
                                            "type": "boolean"
                                        },
                                        "next_page": {
                                            "type": "integer"
                                        },
                                        "previous_page": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/get-profile": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Get the user's Outlook profile",
                "operationId": "6d161b9de6f73c298d03b8dbb4d898e1",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/set-outlook-subscription": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Set up subscriptions for Outlook notifications",
                "description": "Refreshes tokens and sets up subscriptions for Outlook notifications for all users",
                "operationId": "9a86a412042d6aa4b4f140a177217d7e",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription set successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-outlook-response": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Handle webhook responses from Outlook",
                "description": "Processes webhook notifications from Outlook, validates subscription tokens, and handles email notifications. Also manages lead actions based on email replies.",
                "operationId": "05ddc1156d0d72ad068292deef4271dc",
                "parameters": [
                    {
                        "name": "validationToken",
                        "in": "query",
                        "description": "Validation token for subscription verification",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Webhook notification data from Outlook",
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "value": {
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "subscriptionId": {
                                                    "type": "string"
                                                },
                                                "resourceData": {
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success - For validation token requests, returns the token. For notifications, returns empty response.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook response processed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/check-project-client": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Check Outlook project client connection and retrieve profile",
                "operationId": "0f330a7a4dfc94c1807908d814aec3f0",
                "responses": {
                    "200": {
                        "description": "Profile retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "profile": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error while connecting outlook"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/project-oauth2-callback": {
            "get": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Handle Outlook project OAuth2 callback and store access tokens",
                "operationId": "1e14385b343ded590119546a55e3f85f",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Outlook OAuth2 flow",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token has been generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Token has been generated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/outlook/send/{user_id}": {
            "post": {
                "tags": [
                    "Outlook"
                ],
                "summary": "Send an Outlook email on behalf of the specified user",
                "operationId": "c38ea1c711af280c3e23ea4c13ed33bf",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "ID of the user sending the email",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Recipient email address or array of addresses",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mail_body",
                        "in": "query",
                        "description": "Email body content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cc",
                        "in": "query",
                        "description": "Comma separated CC recipients",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bcc",
                        "in": "query",
                        "description": "Comma separated BCC recipients",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reply_to_mail_id",
                        "in": "query",
                        "description": "Outlook message ID to reply to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "append_signature",
                        "in": "query",
                        "description": "Whether to append the user signature",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "file_names",
                        "in": "query",
                        "description": "Array of attachment filenames",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Optional lead ID used for short code replacement",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Error while sending email"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/outlook/list": {
            "get": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "List Outlook calendar events within a date range",
                "operationId": "238ff2010a3d70bc4b9eb91c873329c3",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for the calendar window",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for the calendar window (must be on or after start_date)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Outlook calendar events retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "events": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "colors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or invalid date format"
                    },
                    "500": {
                        "description": "Outlook API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-outlook-calendar-auth": {
            "post": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Check whether the authenticated user has a valid Outlook calendar connection",
                "operationId": "88197e1fbbf525e4a54b37fd9e348f6e",
                "responses": {
                    "200": {
                        "description": "Outlook authentication status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "calendar_email": {
                                            "type": "string"
                                        },
                                        "auth_link": {
                                            "description": "Returned when re-authentication is required",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Outlook API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/outlook/logout": {
            "post": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Disconnect the authenticated user's Outlook calendar integration",
                "operationId": "4fdadd744826d14ef3ad798a06c30da8",
                "responses": {
                    "200": {
                        "description": "Outlook calendar disconnected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-integration/outlook/logout": {
            "post": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Disconnect Outlook calendar from the all-integration flow",
                "operationId": "58679b5bad4bbee0d3d4d3397c5414bf",
                "responses": {
                    "200": {
                        "description": "Outlook calendar disconnected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "You have been logged out successfully."
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/outlook/delete": {
            "delete": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Delete an event from Outlook calendar and the local database",
                "operationId": "8b342f6ce119223488197ba62e5e0d17",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Local event ID to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Viewer role cannot delete events"
                    },
                    "404": {
                        "description": "Event not found"
                    },
                    "500": {
                        "description": "Outlook API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/outlook/create": {
            "post": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Create a new event in Outlook calendar and the local database",
                "operationId": "22da6a41f72c1599e9f22b0cde40d7f1",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Event title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Event description (HTML allowed)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Event start datetime",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Event end datetime (must be on or after start_date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "color_id",
                        "in": "query",
                        "description": "Optional color identifier",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "Event location",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invite_emails",
                        "in": "query",
                        "description": "Comma or semicolon separated list of attendee email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event created successfully."
                                        },
                                        "event_id": {
                                            "type": "string"
                                        },
                                        "event": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Viewer role cannot create events"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Outlook API error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/calendar-event/outlook/update": {
            "post": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Update an existing Outlook calendar event and the local database record",
                "operationId": "d8ab56cf1c6fb806c77f35e4d41eadd2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Local event ID to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Event title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Event description (HTML allowed)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Event start datetime",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Event end datetime (must be on or after start_date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "color_id",
                        "in": "query",
                        "description": "Optional color identifier",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "location",
                        "in": "query",
                        "description": "Event location",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invite_emails",
                        "in": "query",
                        "description": "Comma or semicolon separated list of attendee email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Event updated locally and on Outlook."
                                        },
                                        "event_id": {
                                            "type": "integer"
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Viewer role cannot update events"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/event-cancel-outlook/{id}": {
            "get": {
                "tags": [
                    "Outlook Calendar Event"
                ],
                "summary": "Mark an Outlook calendar event as cancelled",
                "operationId": "6b21cd373a8dd85eebee3bc45e3690a8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Local event ID to cancel",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "error": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Cancelled Successfully"
                                        },
                                        "event": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Event not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemtype": {
            "get": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Get all package item types",
                "operationId": "6d8cc9688fbc1d75c8b30d49a61b890e",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_item_type": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Create a new package item type",
                "operationId": "45f51f8f0ee1a54c761d75e6711a2024",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package item type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Premium Package"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item type created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Item Type Added Successfully."
                                        },
                                        "package_item_type": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemtype/data-table/get": {
            "post": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Get package item types for DataTables",
                "operationId": "1ba32c0e886cd17d6f970e32c0983311",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemtype/{id}": {
            "get": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Get a specific package item type",
                "operationId": "6fd47f6f77209273dc20aa9f933c7fa3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item type",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_item_type": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item type not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Update a specific package item type",
                "operationId": "b1cd019d1e3ac12efd285ba31dfef027",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item type",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package item type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Premium Package"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item type updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Item Type Updated Successfully."
                                        },
                                        "package_item_type": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item type not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Package Item Type"
                ],
                "summary": "Delete a specific package item type",
                "operationId": "0451b26eb1eeb512a52383f0841f5b84",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item type to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item type deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Item Type Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item type not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemslist": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get all package items list",
                "operationId": "8f79b3cee2dfc990983fcc472f6de807",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_items_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Store a new package item",
                "operationId": "2360d8d9b93319190d5c4254fef5f7da",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the package item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rate_month",
                        "in": "query",
                        "description": "Monthly rate of the package item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "limit_month",
                        "in": "query",
                        "description": "Monthly limit of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "rate_year",
                        "in": "query",
                        "description": "Yearly rate of the package item",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "limit_year",
                        "in": "query",
                        "description": "Yearly limit of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "package_item_type_id",
                        "in": "query",
                        "description": "Package item type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the package item",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Package Items Added Successfully"
                                        },
                                        "package_items_list": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemslist/data-table/get": {
            "post": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get package items list for data table",
                "operationId": "9f557469873b6a1b83658a87ce17fbff",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemslist/{id}": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get a specific package item",
                "operationId": "ac48ed258caff400db52cdb638bac4af",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_items_list": {
                                            "type": "object"
                                        },
                                        "clientSecret": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found or other error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Update a package item",
                "operationId": "50e3315f84d00c6352fded1b99c15b20",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package Items Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Items Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Delete a package item",
                "operationId": "55434c2b71ac725df16597a62b4bdd40",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package Items Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Items Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packageitemslist_item_update/{id}": {
            "post": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Update a package item with specific fields",
                "operationId": "aae0eb88ae82302ccdcff69fbe69b698",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "short_description",
                        "in": "query",
                        "description": "Short description of the package item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Description of the package item",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "files",
                        "in": "query",
                        "description": "JSON string of existing files",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file[]",
                        "in": "query",
                        "description": "New files to upload",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package Items Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Items Updated Successfully."
                                        },
                                        "package_items_list": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Package Items Not Found or other error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-package-items-list": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get all package items list based on client's package",
                "operationId": "db4bbca2013f3142084206d632528857",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "package_items_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found or Package Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/updateprimaryimage/{id}": {
            "post": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Update the primary image of a package item",
                "operationId": "06b052e079776eaed66773104fdf7647",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Name of the file to set as primary image",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package Items Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Package Items Updated Successfully."
                                        },
                                        "package_items_list": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-coupon/{code}": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get coupon details by code",
                "operationId": "bff2dec67a47bd9b563dbdc1ffa4da52",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Coupon code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "coupon": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Invalid coupon code or other error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packages": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a list of all packages with their items",
                "operationId": "1c5d87c3ec07a1281538754b1171c9fb",
                "responses": {
                    "200": {
                        "description": "List of packages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "clientSecret": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Packages"
                ],
                "summary": "Create a new package",
                "operationId": "21a3fb57da2017aefe82bb2ca5d06082",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the package",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Billing interval (day, week, month, year)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "interval_count",
                        "in": "query",
                        "description": "Number of intervals between billings",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "package": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/packages/{id}": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a specific package by ID",
                "operationId": "c6c990135fe04820f00c1636ebd26686",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Packages"
                ],
                "summary": "Update a specific package",
                "operationId": "2acf773d5e17127d280ea497a6e2f2da",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the package",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the package",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Billing interval (day, week, month, year)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "interval_count",
                        "in": "query",
                        "description": "Number of intervals between billings",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "package": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Packages"
                ],
                "summary": "Delete a specific package",
                "operationId": "d62a5ac40102e99a6d3879be55bacef1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_package_items": {
            "post": {
                "tags": [
                    "Package Items"
                ],
                "summary": "Get items for a specific package",
                "operationId": "e4b557255d6e6afa330f343be83f4a0e",
                "parameters": [
                    {
                        "name": "package_id",
                        "in": "query",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add_package_item": {
            "post": {
                "tags": [
                    "Package Items"
                ],
                "summary": "Add an item to a package",
                "operationId": "9276748140608e81e1c6a155f56d2fdf",
                "parameters": [
                    {
                        "name": "package_id",
                        "in": "query",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of the item to add",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the item",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit for the item",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit_increase",
                        "in": "query",
                        "description": "Limit increase for the item",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "customizable",
                        "in": "query",
                        "description": "Whether the item is customizable",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "package_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update_package_item": {
            "post": {
                "tags": [
                    "Package Items"
                ],
                "summary": "Update a package item",
                "operationId": "576eddc406497f34c2aace1febc29ce7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the package item to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the item",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit for the item",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit_increase",
                        "in": "query",
                        "description": "Limit increase for the item",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "customizable",
                        "in": "query",
                        "description": "Whether the item is customizable",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "package_items": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_package_item/{id}": {
            "get": {
                "tags": [
                    "Package Items"
                ],
                "summary": "Get a specific package item by ID",
                "operationId": "f3bcc66cfabec55a2b028c1e58a36911",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete_package_item/{id}": {
            "post": {
                "tags": [
                    "Package Items"
                ],
                "summary": "Delete a specific package item",
                "operationId": "b2f8a98b0b915d32053b93818c5424c8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package item deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "package_item": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package item not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/all-packages-list": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a list of all packages without items",
                "operationId": "bf6853d16914d930be4828d5c14edd04",
                "responses": {
                    "200": {
                        "description": "List of packages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/package-list-with-packageitems": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a list of all packages with their items",
                "operationId": "2456348a4d3796353f56769935fc4151",
                "responses": {
                    "200": {
                        "description": "List of packages with items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Packages not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/plan-list-with-packageitems": {
            "post": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a list of packages with items filtered by interval",
                "operationId": "7b157bd732cefb09d59070b46d57add7",
                "parameters": [
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Billing interval (day, week, month, year)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "ID of the client",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of packages with items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Packages not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-package/{id}": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a specific package with its items",
                "operationId": "1d1ac32c20ea36be1fcaa6b8ca4f0b64",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package with items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package": {
                                            "type": "object"
                                        },
                                        "package_items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "clientSecret": {
                                            "type": "string"
                                        },
                                        "subscription": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-package-data/{id}": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get a specific package with its items without authentication",
                "operationId": "33e6f5a670995648293db13d0babb1f1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package with items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "package": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                }
            }
        },
        "/api/package_items_list": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get list of package items",
                "operationId": "8d88163df65a25bc02ffb3232f35981c",
                "responses": {
                    "200": {
                        "description": "Package items list retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/paln-list-with-packageitems": {
            "post": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get plans with their package items filtered by interval",
                "operationId": "684c2edc0dacf893f12cd85f8d82367c",
                "parameters": [
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Billing interval (day, week, month, year)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID used to filter packages by existing plan price",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Plan list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "package": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-package-data-by-stripe-id/{id}": {
            "get": {
                "tags": [
                    "Packages"
                ],
                "summary": "Get package details by Stripe plan id",
                "operationId": "d35c5c640cb7c0873e93f70bcd708303",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Stripe plan id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Package retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "package": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Package not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/performance": {
            "get": {
                "tags": [
                    "Performance"
                ],
                "summary": "Get all performance records for the authenticated user's client",
                "operationId": "3a7762927b259e8c13e84e2ae7d6d24f",
                "responses": {
                    "200": {
                        "description": "Performance records retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Get all performance successfully."
                                        },
                                        "performance": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Performance"
                ],
                "summary": "Create a new performance record",
                "operationId": "ec042bf84958f375fd31afe880d46210",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "month",
                        "in": "query",
                        "description": "Month (1-12)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "maximum": 12
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "description": "Year (4 digits)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int32",
                            "example": 2023
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Performance record created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Performance Added Successfully."
                                        },
                                        "performance": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/performance/{id}": {
            "get": {
                "tags": [
                    "Performance"
                ],
                "summary": "Get a specific performance record by ID",
                "operationId": "f93873dd06865269e2282e955a61dd89",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Performance record ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Performance record retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Performance get successfully"
                                        },
                                        "performance": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Performance record not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Performance"
                ],
                "summary": "Update a specific performance record",
                "operationId": "649287aab4250086e36164cd2d93bea4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Performance record ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "performance",
                        "in": "query",
                        "description": "Performance rating",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "month",
                        "in": "query",
                        "description": "Month (1-12)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "maximum": 12
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "description": "Year (4 digits)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int32",
                            "example": 2023
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Performance record updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Performance Updated Successfully"
                                        },
                                        "performance": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Performance record not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Performance"
                ],
                "summary": "Delete a specific performance record",
                "operationId": "bf7993cadbbebf1f3ea3ed821efea7d4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Performance record ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Performance record deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Performance Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Performance record not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/member-performance": {
            "post": {
                "tags": [
                    "Performance"
                ],
                "summary": "Get performance records for a specific user",
                "operationId": "8c27053126e541cac128bd654b39910c",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "description": "Year (4 digits)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int32",
                            "example": 2023
                        }
                    },
                    {
                        "name": "month",
                        "in": "query",
                        "description": "Month (1-12)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 12
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Performance records retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Get performance successfully."
                                        },
                                        "performance": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Performance records not found"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-twilio-purchase-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get available phone numbers from Twilio",
                "operationId": "2dd26973231b57982d8c52bae1ddb4ff",
                "parameters": [
                    {
                        "name": "countryName",
                        "in": "query",
                        "description": "Country code (defaults to GB if not provided)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "GB"
                        }
                    },
                    {
                        "name": "searchVal",
                        "in": "query",
                        "description": "Search value to filter phone numbers",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "numberType",
                        "in": "query",
                        "description": "Type of phone number (mobile or local)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "mobile",
                                "local"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "phoneNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "prices": {
                                            "type": "number",
                                            "example": 10.99
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve phone numbers"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twilio-country-name": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get list of countries available for Twilio phone numbers",
                "operationId": "ab424cd7870673cdbb18a3bdfa7f9ea2",
                "responses": {
                    "200": {
                        "description": "Countries retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "countryName": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve countries"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/purchase-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Purchase a phone number from Twilio",
                "operationId": "f50653c8bfcb2e76f224c138ad910896",
                "parameters": [
                    {
                        "name": "bundle",
                        "in": "query",
                        "description": "Bundle ID for the phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Payment method ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phoneNo",
                        "in": "query",
                        "description": "Phone number to purchase",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "numberType",
                        "in": "query",
                        "description": "Type of phone number (mobile or local)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "mobile",
                                "local"
                            ]
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the phone number",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Coupon code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number purchased successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone Number Purchase Successfully..!"
                                        },
                                        "phone": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to purchase phone number"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-purchase-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Update purchased phone number details",
                "operationId": "a33eb02189fe42d966f1e2fc68485251",
                "parameters": [
                    {
                        "name": "purchaseNumber",
                        "in": "query",
                        "description": "Phone number to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assignedTo",
                        "in": "query",
                        "description": "User ID to assign the phone number to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "forwardPhoneNumber",
                        "in": "query",
                        "description": "Forward phone number details",
                        "required": false,
                        "schema": {
                            "properties": {
                                "number": {
                                    "type": "string"
                                },
                                "dialCode": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone number Updated Successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Failed to update phone number"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get list of phone numbers for the client",
                "operationId": "053e2528e6b088db7d77b930f93e7eb8",
                "responses": {
                    "200": {
                        "description": "Phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "client_id": {
                                                        "type": "integer"
                                                    },
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "assigned_to": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "phone_number": {
                                                        "type": "string"
                                                    },
                                                    "capabilities": {
                                                        "type": "object"
                                                    },
                                                    "forward_phone_number": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "phone_number_sid": {
                                                        "type": "string"
                                                    },
                                                    "subscription_id": {
                                                        "type": "string"
                                                    },
                                                    "number_type": {
                                                        "type": "string"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "assigned_user": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve phone numbers"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-team-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get list of phone numbers for the client team",
                "operationId": "22029f793d9530fc7729de66e49c7fcb",
                "responses": {
                    "200": {
                        "description": "Team phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "phoneNumberData": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "client_id": {
                                                        "type": "integer"
                                                    },
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "assigned_to": {
                                                        "type": "integer",
                                                        "nullable": true
                                                    },
                                                    "phone_number": {
                                                        "type": "string"
                                                    },
                                                    "capabilities": {
                                                        "type": "object"
                                                    },
                                                    "forward_phone_number": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "phone_number_sid": {
                                                        "type": "string"
                                                    },
                                                    "subscription_id": {
                                                        "type": "string"
                                                    },
                                                    "number_type": {
                                                        "type": "string"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "assigned_user": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve team phone numbers"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/set-team-phone-number-forward": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Forward phone calls to a specific user's phone number",
                "operationId": "d7ca2bd580987f388677af0dab671c14",
                "parameters": [
                    {
                        "name": "phone_id",
                        "in": "query",
                        "description": "ID of the phone number to forward from",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user to forward calls to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number forwarding set successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to set phone number forwarding"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-client-users": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get user assigned to a specific phone number",
                "operationId": "f53cd63176cb1f28d84bdf29c6e1c12e",
                "parameters": [
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number to check",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number user data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "phoneNumberData": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "assigned_to": {
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "forward_phone_number": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve phone number user data"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/number-assign-user": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Assign a phone number to a specific user",
                "operationId": "7624a0c007a195a049f424ce852ca16f",
                "parameters": [
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number to assign",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phone_number_id",
                        "in": "query",
                        "description": "ID of the phone number",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the phone number to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "incomingCallOption",
                        "in": "query",
                        "description": "Option for handling incoming calls (forwardNumber or other)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "forwardPhoneNumber",
                        "in": "query",
                        "description": "Forward phone number details (required if incomingCallOption is forwardNumber)",
                        "required": false,
                        "schema": {
                            "properties": {
                                "number": {
                                    "type": "string"
                                },
                                "dialCode": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number assigned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone number updated successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Failed to assign phone number"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/release-phone-number": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Release a purchased phone number",
                "operationId": "b343104565dc7cfee45b054bb508e470",
                "parameters": [
                    {
                        "name": "subscription_id",
                        "in": "query",
                        "description": "Subscription ID of the phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number released successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone number release successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "400": {
                        "description": "Failed to release phone number"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-twilio-number-assign": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Check if the authenticated user has an assigned phone number",
                "operationId": "3bd5eeb9506283f3040cb9ec58779ff3",
                "responses": {
                    "200": {
                        "description": "Phone number assignment check successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "phone_number": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to check phone number assignment"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-bundle-list/{type}": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get list of bundles by type",
                "operationId": "fb66ff1dbd9b19e1c31e3d739cf4434c",
                "parameters": [
                    {
                        "name": "type",
                        "in": "path",
                        "description": "Type of bundle (mobile or local)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "mobile",
                                "local"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bundles retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "bundle": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "bundle_sid": {
                                                        "type": "string"
                                                    },
                                                    "friendly_name": {
                                                        "type": "string"
                                                    },
                                                    "number_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Failed to retrieve bundles"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/without-payment-purchase-phone-number": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Purchase a free Twilio phone number from plan inclusions without payment",
                "operationId": "88429b660f8fc260128485fbd0ae6e2e",
                "parameters": [
                    {
                        "name": "bundle",
                        "in": "query",
                        "description": "Twilio bundle SID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phoneNo",
                        "in": "query",
                        "description": "Phone number to purchase",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "numberType",
                        "in": "query",
                        "description": "Type of phone number (mobile or local)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "mobile",
                                "local"
                            ]
                        }
                    },
                    {
                        "name": "countryName",
                        "in": "query",
                        "description": "Country code for the phone number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number purchased successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone Number Purchase Successfully..!"
                                        },
                                        "phone": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Phone Number Not Purchase"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/purchase-number-confirm-payment": {
            "post": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Confirm Stripe payment for a phone number purchase and complete the order",
                "operationId": "aa39772caf1cde4a602bca1309f4fc4b",
                "parameters": [
                    {
                        "name": "request_data",
                        "in": "query",
                        "description": "Original purchase request data including stripePrice and subscription_id",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "payment_info",
                        "in": "query",
                        "description": "Payment information with status from Stripe",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number purchased successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "phone": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-purchase-phone-number-for-sms": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get purchased phone numbers with SMS capability for the authenticated client",
                "operationId": "d67edf2a146f355ce63bb847c3aff362",
                "responses": {
                    "200": {
                        "description": "Phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Get phone number Successfully..!"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "phone_number": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No phone numbers found for the client"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-purchase-phone-number-for-voice-by-user-id/{user_id}": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Get purchased phone numbers with voice capability assigned to the given user",
                "operationId": "1e01b60772f7aa373b1f39fe0b931dd0",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "path",
                        "description": "ID of the user (or comma-separated IDs) to filter assigned voice numbers",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Get phone number Successfully..!"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "phone_number": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No phone numbers found for the client"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twilio-number-types/{country}": {
            "get": {
                "tags": [
                    "Phone Numbers"
                ],
                "summary": "Number types purchasable in a country",
                "description": "Twilio search availability for the country (cached for a day), minus toll_free, falling back to local+mobile when Twilio is unreachable or unconfigured. A type Twilio newly offers appears automatically, but its search branches / pricing rows must exist before it actually returns numbers.",
                "operationId": "12aec3bdf56ad1236c680a388786d976",
                "parameters": [
                    {
                        "name": "country",
                        "in": "path",
                        "description": "ISO 3166-1 alpha-2 country code (e.g. GB, US)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GB"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Available number types",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "number_types": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "local"
                                            },
                                            "example": [
                                                "local",
                                                "mobile",
                                                "national"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ppc-report": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Get a list of PPC reports",
                "operationId": "186e563c084621acd1539611c6317e30",
                "responses": {
                    "200": {
                        "description": "List of PPC reports retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Create a new PPC report",
                "operationId": "3da9831108418f68b16f507b92754bb7",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Email subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Email message content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cc_emails",
                        "in": "query",
                        "description": "CC email addresses (comma separated)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "files[]",
                        "in": "query",
                        "description": "Report files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC report created successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ppc-report/data-table": {
            "post": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Get PPC reports data for datatable",
                "operationId": "6ccaac827bfe7548bf7723ecd50fcb65",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "email_sent",
                        "in": "query",
                        "description": "Filter by email sent status",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by start date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by end date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC reports data retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ppc-report/{id}": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Get a specific PPC report",
                "operationId": "88733e4a9eb614f74262829e90e8df34",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC report retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "PPC report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Send a PPC report email",
                "operationId": "eb80c23d56cf2cd0ac849eb0d00d9c0b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC report sent successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "PPC report not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Delete a PPC report",
                "operationId": "d4ed4b932732875e9a500f0a684603e5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC report deleted successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "PPC report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ppc_report_tracking/{id}": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Track when a PPC report email is opened",
                "operationId": "06efebe256abfaf38b286d27d993b57a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email tracking recorded successfully"
                    },
                    "404": {
                        "description": "PPC report not found"
                    }
                }
            }
        },
        "/api/ppc-report/download-attachment": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Download a PPC report attachment",
                "operationId": "b61a5442cb391b9f7996eb07754bced1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment to download",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/users-all": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "Get all users with their company information",
                "operationId": "9d9266c7f1152dd36683f95867f1e632",
                "responses": {
                    "200": {
                        "description": "List of users retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/report_view/ppc/{id}": {
            "get": {
                "tags": [
                    "PPC Reports"
                ],
                "summary": "View a PPC report",
                "operationId": "9efcde0bbfc148544c186fdf2b090df1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "PPC Report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PPC report details retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "PPC report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/product": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get all package items list",
                "operationId": "75c603cef0922d833fd5d84e602b672c",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_items_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/product/{slug}": {
            "get": {
                "tags": [
                    "Package Items List"
                ],
                "summary": "Get a specific package item",
                "operationId": "40d09f526e349ba5a01515d03bc1aee2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the package item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_items_list": {
                                            "type": "object"
                                        },
                                        "clientSecret": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found or other error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/products": {
            "get": {
                "tags": [
                    "Product"
                ],
                "summary": "List marketplace products grouped by internal vs external origin",
                "operationId": "2ef45fbb1432ebbffc8bb742c31f13a4",
                "responses": {
                    "200": {
                        "description": "Products returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "package_items_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "package_items_list_internal": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "package_items_list_external": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Package Items Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/singal-product/{slug}": {
            "get": {
                "tags": [
                    "Product"
                ],
                "summary": "Get a single product by slug (with variables for variable products)",
                "operationId": "c0c4b7c8500ab646b87e9a664ce31270",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Product slug",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Product returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "product": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Product Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Product Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-attachment": {
            "get": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Get all project attachments",
                "operationId": "3056d8bc3ec7720238d33fd312ab88cb",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "project_attachment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Project Attachment Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Store a new project attachment",
                "operationId": "c3c219fbe5ab684bccac1b0b43278112",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Description of the attachment",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload",
                        "required": true,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project Attachment Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Attachment Added Successfully"
                                        },
                                        "project_attachment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-attachment/data-table/get": {
            "post": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Get project attachments for data table",
                "operationId": "68824ac256208472cd560b168985af15",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-project/attachment": {
            "get": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Get all project attachments",
                "operationId": "dc40fcaad0b0ee9b9eff11def3f3dae5",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "project_attachment": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-attachment/{id}": {
            "get": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Get a specific project attachment",
                "operationId": "12698affdf4e20869137c98174c736b0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project attachment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "project_attachment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Project Attachment Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Attachments"
                ],
                "summary": "Delete a project attachment",
                "operationId": "6f8ef878687f73b204e8156fa083224a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project attachment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project Attachment Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Attachment Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Project Attachment Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-attachment/data-table/get/{id}": {
            "post": {
                "tags": [
                    "Project Attachment"
                ],
                "summary": "Get project attachments for a project formatted for DataTables",
                "operationId": "cd9c324235daf85ac91214149f68267c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-attachment/{project_attachment}": {
            "put": {
                "tags": [
                    "Project Attachment"
                ],
                "summary": "Update a project attachment (resource update – placeholder, not currently implemented)",
                "operationId": "3c50e222c0c8f2dced5f7f22c49e6fa5",
                "parameters": [
                    {
                        "name": "project_attachment",
                        "in": "path",
                        "description": "Project attachment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project_categories/data-table/get": {
            "post": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Get project categories for data table",
                "operationId": "2520c97f0b3eeed18abce3396da4773d",
                "responses": {
                    "200": {
                        "description": "Project categories retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project_categories": {
            "get": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Get all project categories",
                "operationId": "5bf802efb041651747af72b151a4ca21",
                "responses": {
                    "200": {
                        "description": "Project categories retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "category": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Create a new project category",
                "operationId": "48b7bbbe0cb10e57594b9c1ce657e5fd",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the project category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Web Development"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project category created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Project Category Added Successfully"
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Something went wrong"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project_categories/{id}": {
            "get": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Get a specific project category",
                "operationId": "e70d8bce2b375b69274c09364680ad41",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project category retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project category not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Update a specific project category",
                "operationId": "9712bc71d2c7e826c9331c9e1509374b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the project category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Web Development"
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "ID of the project category (for validation)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project category updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Category Updated Successfully"
                                        },
                                        "category": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project category not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Categories"
                ],
                "summary": "Delete a specific project category",
                "operationId": "f38fa4c504179e32070ce6613d2f13a7",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the project category",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project category deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Category Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Cannot delete category assigned to projects",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "You can not delete this category because it is already assigned to one or more projects."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project category not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Category Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-comments": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "List project comments",
                "operationId": "2692526313f1386f59c083d6977a8399",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Store a new project comment",
                "operationId": "91a707da343159085e9463e5adbe0cd4",
                "parameters": [
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Comment description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "task_id",
                        "in": "query",
                        "description": "Task ID (optional)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "file_name[]",
                        "in": "query",
                        "description": "Attachment files (optional)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Comment Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-comments/{id}": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Get comments for a specific project",
                "operationId": "8dcda792b19330580d526aaeebe4019f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Delete a project comment",
                "operationId": "c8ed06f7389dd4c74471b9bd47c3a6f6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Comment Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Comment not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Comment Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-comment/{tid}": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Get comments for a specific task",
                "operationId": "1f39689b6347af61e1de6eba31c33676",
                "parameters": [
                    {
                        "name": "tid",
                        "in": "path",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-sub-tasks-comment/{tid}": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Get comments for a specific subtask",
                "operationId": "fe038dacd5520605c1263e5c1aa64651",
                "parameters": [
                    {
                        "name": "tid",
                        "in": "path",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "Comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-comment/download-attachment": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Download an attachment from a comment",
                "operationId": "7a93afb74abd11ebc53de66b93aec1d9",
                "parameters": [
                    {
                        "name": "comment_id",
                        "in": "query",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment in the comment's files array",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download response"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-comment/download-attachment-zip": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Download all attachments from a comment as a zip file",
                "operationId": "6d354f53d991fced690138b5c7b1a229",
                "parameters": [
                    {
                        "name": "comment_id",
                        "in": "query",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Zip file download response"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Files not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/comment-replies/{id}": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Get replies for a project comment",
                "operationId": "eb3fbea6ae0d61c9550915034ee08c30",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the parent project comment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Replies retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "replies": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "replies_count": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/edit-project-task-comment/{id}": {
            "post": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Edit a project/task comment",
                "operationId": "c289810ca51992e0c9ece94cfec1c0b9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the comment to edit",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Updated comment description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Files to attach to the comment",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Comment Updated Successfully"
                                        },
                                        "comment": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Comment not found or permission denied"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-task-comment-file/{taskCommentId}": {
            "post": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Delete a file from a task comment",
                "operationId": "f852fa6eee54a4bfbab54b5241b8e128",
                "parameters": [
                    {
                        "name": "taskCommentId",
                        "in": "path",
                        "description": "ID of the task comment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment to delete within the comment's files array",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File has been removed from task comment"
                                        },
                                        "files": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Task comment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-comments/{project_comment}": {
            "put": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Update the specified project comment",
                "operationId": "762a8e3cfb942e171c9cd31e540efa39",
                "parameters": [
                    {
                        "name": "project_comment",
                        "in": "path",
                        "description": "ID of the project comment to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project comment updated"
                    },
                    "404": {
                        "description": "Project comment not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get all projects for the authenticated user's client",
                "operationId": "4b63e0dc6f14f12d45c4279c0e5ec655",
                "responses": {
                    "200": {
                        "description": "List of projects",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "projects": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Create a new project",
                "operationId": "4e7387e7ab8a3d995b806eebc865a068",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Project title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Project start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "deadline",
                        "in": "query",
                        "description": "Project deadline (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "last_email_sent_date",
                        "in": "query",
                        "description": "Last email sent date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "project": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project/data-table/get": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get projects data for DataTable with filtering and pagination",
                "operationId": "edd8e792198a566675449941b0d4edf8",
                "responses": {
                    "200": {
                        "description": "Projects data for DataTable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project/{id}": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get a specific project by ID",
                "operationId": "7ba87c6bb438f74b28e94787ac11207c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Projects"
                ],
                "summary": "Update a specific project",
                "operationId": "05e6f45a26a48535369bb9290532e093",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Project title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Project start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "deadline",
                        "in": "query",
                        "description": "Project deadline (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "project": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Project not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Projects"
                ],
                "summary": "Delete a specific project",
                "operationId": "4f7e079366b92d015358dd7e53a3fea0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/search-project": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Search for projects",
                "operationId": "45623577be9ae2c3f3b71e9d5ec58b1f",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No search results found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project/activities/{id}": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get activities for a specific project",
                "operationId": "95d72d2c1d8a3e370ee31fdbad9f1c5e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering activities (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering activities (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project activities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "activities": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "fetch_from": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-clients": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get all clients for projects",
                "operationId": "6f7477b9441336352df8caa363e37dc3",
                "responses": {
                    "200": {
                        "description": "List of clients",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "first_name": {
                                                "type": "string"
                                            },
                                            "last_name": {
                                                "type": "string"
                                            },
                                            "email": {
                                                "type": "string"
                                            },
                                            "client_id": {
                                                "type": "integer"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project/statistics": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get project statistics",
                "operationId": "94a0857dd75afcad9bf5daa451592369",
                "responses": {
                    "200": {
                        "description": "Project statistics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "statistics": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        },
                                        "count": {
                                            "type": "integer"
                                        },
                                        "projectStatusLabel": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-by-status": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get projects grouped by status",
                "operationId": "24cf883e00ab8121d11654a479e00d17",
                "parameters": [
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "Status ID to filter projects",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "searchBy",
                        "in": "query",
                        "description": "Search criteria",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Projects grouped by status",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "projects": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "searchBy": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-status-update": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Update project status",
                "operationId": "86bbce4d8f2575bfd074c69d64ae40c5",
                "parameters": [
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "Status ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "project": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-index-update": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Update project list index",
                "operationId": "31932067188163083211f9320f9887c4",
                "parameters": [
                    {
                        "name": "project_data",
                        "in": "query",
                        "description": "Array of project data with project_id and index",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "project_id": {
                                        "type": "integer"
                                    },
                                    "index": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project indexes updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-as-favourite": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Set project as favourite",
                "operationId": "2867bc2e6bfc61c06638bd2ee3c4a3ba",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_favourite",
                        "in": "query",
                        "description": "Favourite status (0 or 1)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project favourite status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "result": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-activities-log": {
            "get": {
                "tags": [
                    "Activity Logs"
                ],
                "summary": "Get activity log grouped by type",
                "description": "Returns a list of activity logs filtered by optional start and end dates. Groups results by activity type.",
                "operationId": "getActivityLog",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with grouped activities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "activities": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "log_name": {
                                                        "type": "string",
                                                        "example": "Project"
                                                    },
                                                    "description": {
                                                        "type": "string",
                                                        "example": "Created a new project"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2025-05-29T12:34:56"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 5
                                        },
                                        "pages": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/project/{projectId}/custom-field/{customFieldId}": {
            "delete": {
                "tags": [
                    "Projects"
                ],
                "summary": "Delete project custom field file type",
                "operationId": "d8bc710dd9d62b7fc47428e846a79b07",
                "parameters": [
                    {
                        "name": "projectId",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "customFieldId",
                        "in": "path",
                        "description": "Custom Field ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Custom field value deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project or custom field not found"
                    },
                    "500": {
                        "description": "Server error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-project-quotes/{projectId}": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get quotes associated with a specific project",
                "operationId": "0280880a27ce137dc78356eb623e2e50",
                "parameters": [
                    {
                        "name": "projectId",
                        "in": "path",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project quotes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "project_quotes": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project quotes not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/associate-project-with-quote": {
            "post": {
                "tags": [
                    "Projects"
                ],
                "summary": "Associate a quote with a project",
                "operationId": "748a1732a6bd8b7dbed82026df9bdaaf",
                "parameters": [
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "quote_id",
                        "in": "query",
                        "description": "ID of the quote",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Quote associated with project successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quote associated with project successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Project or quote not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project/client/{id}": {
            "get": {
                "tags": [
                    "Projects"
                ],
                "summary": "Get projects belonging to a specific client where the authenticated user is a member",
                "operationId": "96fa7fb14f678f57ee77401743ebaacd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Projects retrieved successfully"
                    },
                    "404": {
                        "description": "No projects found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-files": {
            "get": {
                "tags": [
                    "Project Files"
                ],
                "summary": "List project files (resource index – placeholder, not currently implemented)",
                "operationId": "234b0f6dea57be12705aab07dee6d808",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Store new project files",
                "operationId": "447b092122fd64210ec9ebcf9a7bc95d",
                "parameters": [
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "description[]",
                        "in": "query",
                        "description": "Description for each file",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "project_files[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Files added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Files Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-files/{id}": {
            "get": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Get files for a specific project",
                "operationId": "89a9f54e539b76906ca2a4f09c54ed7a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "files": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Files not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Files Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Delete a specific file",
                "operationId": "aea0a5ce6fead2304bcba844723bea2b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "File ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "File Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "File not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "File Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/file-upload": {
            "post": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Upload files without authentication",
                "operationId": "5e32731fb04bf525a4fa0661a66c6c94",
                "parameters": [
                    {
                        "name": "project_files[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Files uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Upload file not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": "upload_file_not_found"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/secured-file-upload": {
            "post": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Upload files with authentication",
                "operationId": "ad0e2dfa95ed4a4971fc1cb4e4522d29",
                "parameters": [
                    {
                        "name": "project_files[]",
                        "in": "query",
                        "description": "Files to upload",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name parameter",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Files uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Upload file not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": "upload_file_not_found"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-files/{project_file}": {
            "put": {
                "tags": [
                    "Project Files"
                ],
                "summary": "Update a project file (resource update – placeholder, not currently implemented)",
                "operationId": "5f034df58249646dd0410694c763a7be",
                "parameters": [
                    {
                        "name": "project_file",
                        "in": "path",
                        "description": "Project file ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-members": {
            "get": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Get all users from the authenticated user's client",
                "operationId": "5b9eb6398cbbfbd330bb182237f43b00",
                "responses": {
                    "200": {
                        "description": "List of users retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Add members to a project",
                "operationId": "ae22c1a422d7aab38e9638b1a2b51301",
                "parameters": [
                    {
                        "name": "user_ids",
                        "in": "query",
                        "description": "Array of user IDs to add to the project",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Members added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Member Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-members/{id}": {
            "get": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Get members of a specific project",
                "operationId": "055ae2b728274e043f7bfad238496cd6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project members retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "members_ids": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "member_name": {
                                                        "type": "string"
                                                    },
                                                    "job_title": {
                                                        "type": "string"
                                                    },
                                                    "profile_img": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Project not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Remove a member from a project",
                "operationId": "eccd0e3d23d54180347d8d0dae212262",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project Member ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Member deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Member Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Member not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Member Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-members/data-table/{id}": {
            "post": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Get project members in datatable format",
                "operationId": "b4dc108682259ef2e986d859dd573b2d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project members retrieved in datatable format",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-external-project-members": {
            "post": {
                "tags": [
                    "Project Members"
                ],
                "summary": "Add external members to a project",
                "operationId": "9590a30fb1934412ae8b765281e0bba4",
                "parameters": [
                    {
                        "name": "external_email",
                        "in": "query",
                        "description": "Email of the external member",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "ID of the project",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "An email to join the project has been sent to the member."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Project already assigned to member",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Project has already assigned to member with this email address."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-members/{project_member}": {
            "put": {
                "tags": [
                    "Project Member"
                ],
                "summary": "Update a project member (resource update – placeholder, not currently implemented)",
                "operationId": "70ec0e7752558dc9da69157bd6555e2b",
                "parameters": [
                    {
                        "name": "project_member",
                        "in": "path",
                        "description": "Project member ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-note": {
            "get": {
                "tags": [
                    "Project Note"
                ],
                "summary": "List project notes (resource index – placeholder, not currently implemented)",
                "operationId": "4cc33d74341570eeb47208da26c2e372",
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Notes"
                ],
                "summary": "Create a new project note",
                "operationId": "551c24b3666aef7be7e12a9bb8eba165",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Note title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Important Note"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Note description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "This is an important note about the project"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project Note Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Note Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-note/{id}": {
            "get": {
                "tags": [
                    "Project Notes"
                ],
                "summary": "Get project notes for a specific project",
                "operationId": "5cf64e18b572f9d119242cb9c4179032",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "note": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Project not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Project Notes"
                ],
                "summary": "Update a specific project note",
                "operationId": "1ca16f99359edacea51f9a1df28356cc",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project Note ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Note title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated Note Title"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Note description",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Updated note description"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project Note Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Project Note Updated Successfully"
                                        },
                                        "note": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Note Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Notes"
                ],
                "summary": "Delete a specific project note",
                "operationId": "77a4735a4ecef8e1c10bef041b12291a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project Note ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Note Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Note Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/search-by-title": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Search tasks by title",
                "operationId": "7ce71ed0590d487721ead328c7768448",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task created successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/data-table/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get project tasks data for datatable",
                "operationId": "0078b07c6b1e659feb9bd7aa6693f6af",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "collaborators",
                        "in": "query",
                        "description": "Filter by collaborator IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "leabls",
                        "in": "query",
                        "description": "Filter by labels",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-all-tasks/data-table": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get all project tasks data for datatable",
                "operationId": "2713f68a356e9a4551333858fdc1b803",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Start index for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records to return",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "List project tasks (placeholder endpoint)",
                "operationId": "da8095c2e0344e678084b2203e7d6e55",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Create a new project task",
                "operationId": "4b035412e9809212b5a00ef7ba68ad1e",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Task description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the task to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "collaborators",
                        "in": "query",
                        "description": "Array of user IDs as collaborators",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "deadline",
                        "in": "query",
                        "description": "Deadline date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "Status ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "labels",
                        "in": "query",
                        "description": "Task labels",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cost",
                        "in": "query",
                        "description": "Task cost",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "time_estimate",
                        "in": "query",
                        "description": "Time estimate in hours",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task created successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/{id}": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get details of a specific project task",
                "operationId": "f46bfed655dfa7306dbf8fdf5a35f888",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "tasks": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Update a project task",
                "operationId": "67a482665136638a05d5b5ab7299c592",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Task description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the task to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "collaborators",
                        "in": "query",
                        "description": "Array of user IDs as collaborators",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "deadline",
                        "in": "query",
                        "description": "Deadline date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "Status ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "labels",
                        "in": "query",
                        "description": "Task labels",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cost",
                        "in": "query",
                        "description": "Task cost",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "time_estimate",
                        "in": "query",
                        "description": "Time estimate in hours",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task updated successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Delete a project task",
                "operationId": "604bdc5f663f4b48f4a206e464ae1f57",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task deleted successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-open-tasks-count": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get count of open tasks",
                "operationId": "06d5feb3611c408d58e558698566ac0c",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering tasks",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering tasks",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "count": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-tasks-status-count/{id}": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get count of tasks by status for a project",
                "operationId": "4848e71fd61c28f7791ca8ed6a1ce0e2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "to_do": {
                                            "type": "integer"
                                        },
                                        "in_progress": {
                                            "type": "integer"
                                        },
                                        "done": {
                                            "type": "integer"
                                        },
                                        "new_data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/statistics": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get project tasks statistics",
                "operationId": "ed605f427289ba4f3171edf9bcddc230",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "statistics": {
                                            "properties": {
                                                "to_do": {
                                                    "type": "integer"
                                                },
                                                "to_doTotal": {
                                                    "type": "string"
                                                },
                                                "in_progress": {
                                                    "type": "integer"
                                                },
                                                "in_progressTotal": {
                                                    "type": "string"
                                                },
                                                "done": {
                                                    "type": "integer"
                                                },
                                                "doneTotal": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "count": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-task-by-status": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get task list by project ID",
                "operationId": "0b9a7cdf51f184e8d71948a3b47a6fc1",
                "parameters": [
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "Status ID to filter tasks",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "tasks": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "pages": {
                                            "type": "integer"
                                        },
                                        "total": {
                                            "type": "integer"
                                        },
                                        "active_page": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-task-status-update": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Update project task status",
                "operationId": "fb558df9419cd15eddbe4300921e6e26",
                "parameters": [
                    {
                        "name": "task_id",
                        "in": "query",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status_id",
                        "in": "query",
                        "description": "New status ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "404": {
                        "description": "Task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-download-attachment": {
            "get": {
                "tags": [
                    "Project Comments"
                ],
                "summary": "Download an attachment from a comment",
                "operationId": "f0000c13599a7bf72ba7929be34d50e9",
                "parameters": [
                    {
                        "name": "comment_id",
                        "in": "query",
                        "description": "Comment ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment in the comment's files array",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download response"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Download a project task attachment",
                "operationId": "2d710059ac6aaff5c92aeb97737739db",
                "parameters": [
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Stored file name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file_path",
                        "in": "query",
                        "description": "Local file path (used when storage is not S3)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File stream"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/task-index-update": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Update task list index",
                "operationId": "c553d8256e9178d970fcf1e6786c12ba",
                "parameters": [
                    {
                        "name": "task_data",
                        "in": "query",
                        "description": "Array of task data with task_id and index",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "task_id": {
                                        "type": "integer"
                                    },
                                    "index": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Task indexes updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/timer/start/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Start the timer for a project task",
                "operationId": "0e38e640405ee58a42c90cfd60ecd85c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Timer started"
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/timer/stop/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Stop the timer for a project task",
                "operationId": "daf548a61aeb226cdd3b10bc9b20050e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "minutes",
                        "in": "query",
                        "description": "Deprecated: elapsed time is now computed server-side from tracked_start_time. Ignored if sent.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Timer stopped"
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks/timer/push/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Pause/push the timer for a project task",
                "operationId": "dc11b23d742140cecc24f6eeefcb4832",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "minutes",
                        "in": "query",
                        "description": "Deprecated: elapsed time is now computed server-side from tracked_start_time. Ignored if sent.",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Timer paused"
                    },
                    "404": {
                        "description": "Task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-activity/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get activity log for a project task",
                "operationId": "1fab109b570f3d565208edc8772c08a2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "log_name",
                        "in": "query",
                        "description": "Filter by activity log name",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "causer_id",
                        "in": "query",
                        "description": "Filter by user ID who caused the activity",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Activities retrieved successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-activity-log": {
            "get": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Get aggregated activity log for project tasks",
                "operationId": "7f470ae21cdf447b7f112a94905bcc13",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Subject ID (task ID) to filter by",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Activity log retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-tasks-update/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Update a project task (multipart-aware update endpoint)",
                "operationId": "a640d24aacf78b87d4c1220351d34caf",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title (required when provided in payload)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "deadline",
                        "in": "query",
                        "description": "Deadline date (Y-m-d)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the task to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "collaborators",
                        "in": "query",
                        "description": "Array of collaborator user IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Attachment files to upload",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project task updated successfully"
                    },
                    "404": {
                        "description": "Project task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/estimate-download-attachment": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Download an estimate attachment",
                "operationId": "d2f0e888cead05c3b8524f2105106f88",
                "parameters": [
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "Stored file name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file_path",
                        "in": "query",
                        "description": "Local file path (used when storage is not S3)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File stream"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-task-file/{id}": {
            "post": {
                "tags": [
                    "Project Tasks"
                ],
                "summary": "Delete an attachment file from a project task",
                "operationId": "45420121c1c1c14367a3f546d8fc3374",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment to remove",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Attachment deleted successfully"
                    },
                    "404": {
                        "description": "Task or attachment not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-sub-tasks/data-table/{id}": {
            "post": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Get project sub-tasks data in datatable format",
                "operationId": "62c15a5ceb0b504043bd44cfbcbbf000",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project sub-tasks data retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-sub-tasks": {
            "get": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Display a listing of project sub-tasks",
                "operationId": "5e9665619acb62f18c9ab95dc10f241d",
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Create a new project sub-task",
                "operationId": "fc1faa74bd59c4d9b6cc09b5e5920e32",
                "parameters": [
                    {
                        "name": "task_id",
                        "in": "query",
                        "description": "Task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sub_task_title",
                        "in": "query",
                        "description": "Sub-task title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "time_in_minutes",
                        "in": "query",
                        "description": "Time spent on the sub-task in minutes",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "project_id",
                        "in": "query",
                        "description": "Project ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sub-task created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Task Timing Added Successfully."
                                        },
                                        "sub_task": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-sub-tasks/{id}": {
            "get": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Get a specific project sub-task",
                "operationId": "b600ef7989ea06d0fb03f50dae934168",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project sub-task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project sub-task retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Task Timing Found."
                                        },
                                        "sub_task": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Project sub-task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Update a specific project sub-task",
                "operationId": "2b39ec43b4c562e72f9be4bf21083b54",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project sub-task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sub_task_title",
                        "in": "query",
                        "description": "Sub-task title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "time_in_minutes",
                        "in": "query",
                        "description": "Time spent on the sub-task in minutes",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project sub-task updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Task Timing Updated Successfully."
                                        },
                                        "sub_task": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Project sub-task not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Delete a specific project sub-task",
                "operationId": "7068cf9fed0cbba036ba031726e8737f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Project sub-task ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Project sub-task deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Task Timing Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Project sub-task not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/project-sub-tasks/date-wise-sub-task-report-summary": {
            "post": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Get date-wise sub-task report with summary",
                "operationId": "98c4f206532072ad313886fc3c4a2617",
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Date for the report (format: Y-m-d)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sub task report with summary retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Sub Task Report with Summary Found."
                                        },
                                        "projects": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total_time": {
                                            "type": "string",
                                            "example": "8 hours 30 minutes"
                                        },
                                        "date": {
                                            "type": "string",
                                            "format": "date",
                                            "example": "2023-01-01"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-subtask-file/{subtaskId}": {
            "post": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Delete a file attachment from a project subtask",
                "operationId": "53b8d340aaee9e875c873425c854b6ef",
                "parameters": [
                    {
                        "name": "subtaskId",
                        "in": "path",
                        "description": "ID of the project subtask",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Index of the attachment to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subtask attachment deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subtask Attachment Deleted successfully"
                                        },
                                        "files": {
                                            "type": "string"
                                        },
                                        "deleted_index": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Subtask not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-subtask-status": {
            "post": {
                "tags": [
                    "Project Sub Tasks"
                ],
                "summary": "Update the status of a project subtask",
                "operationId": "f1b0faf91ab1122370abd64fae717e2f",
                "parameters": [
                    {
                        "name": "subtask_id",
                        "in": "query",
                        "description": "ID of the subtask",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "subtask_status_id",
                        "in": "query",
                        "description": "New status ID of the subtask",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subtask status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subtask Status Updated Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add_qb_keys": {
            "post": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Add QuickBooks API keys",
                "operationId": "3d277fa5c3da4c1ee8255315144f100f",
                "parameters": [
                    {
                        "name": "ClientID",
                        "in": "query",
                        "description": "QuickBooks Client ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ClientSecret",
                        "in": "query",
                        "description": "QuickBooks Client Secret",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "QuickBooks keys added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quickbook Keys added successfully."
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_qb_keys/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Get QuickBooks API keys for a user",
                "operationId": "50c6da19b0ed20bb7453ee8ffce289d8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "QuickBooks keys retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Keys not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/quickbook-integration/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Set up QuickBooks integration and create authentication link",
                "operationId": "87e0dad8878e3fcf366add889d35e718",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authentication link created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "authUrl": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error creating authentication link"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-qb-connection": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Check QuickBooks connection status",
                "operationId": "b55f3bd96ed89dc21be9b76d42474ae6",
                "responses": {
                    "200": {
                        "description": "Connection status retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error checking connection"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/refresh": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Refresh QuickBooks access token",
                "operationId": "4b323b208d9cd0880499b0db76ea7c91",
                "responses": {
                    "200": {
                        "description": "Token refreshed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Token refreshed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error refreshing token"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-all-estimates": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Show all QuickBooks estimates",
                "operationId": "993a273d40a05309d1ba01f3d0bf97a6",
                "responses": {
                    "200": {
                        "description": "Estimates retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "all_estimates": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving estimates"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-all-bill": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Show all QuickBooks bills",
                "operationId": "126f3bc018bf91a2988a904df8146bee",
                "responses": {
                    "200": {
                        "description": "Bills retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "bill_info": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-all-invoice/{id}/{date}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Show all QuickBooks invoices",
                "operationId": "073e3c2cbe411bb8769424218ceb12cd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "path",
                        "description": "Date filter",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoices retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_show_all_items": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Show all QuickBooks items",
                "operationId": "a0c591da69b776c9f9606800119b9bc4",
                "responses": {
                    "200": {
                        "description": "Items retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "all_items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving items"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-all-customer": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Show all QuickBooks customers",
                "operationId": "5d7f7a22b6fc94086f0f03ab7e4d64a4",
                "responses": {
                    "200": {
                        "description": "Customers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "all_customers": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving customers"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/view_qb_ind_customer/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "View individual QuickBooks customer",
                "operationId": "5f7b64bd5b284e97d6ac5ef8650b67a6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Customer ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Customer retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving customer"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_delete_invoice/{id}": {
            "delete": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Delete a QuickBooks invoice",
                "operationId": "00cec008ba0c8f722bb212db9a30b1f5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error deleting invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-ind-invoice/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "View individual QuickBooks invoice",
                "operationId": "cf63fce7f3730387aa00de580fbb880d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-ind-estimate/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "View individual QuickBooks estimate",
                "operationId": "30decd78ae465e4ce6d84ef50fa42809",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Estimate ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Estimate retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving estimate"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-show-ind-bill/{id}": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "View individual QuickBooks bill",
                "operationId": "3c19ba9860be83104e589501035098df",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Bill ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bill retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving bill"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-compnay_info": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Get QuickBooks company information",
                "operationId": "0705fad826cb4d21534eb07f0d1c596b",
                "responses": {
                    "200": {
                        "description": "Company information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving company information"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-account-details": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "View QuickBooks account details",
                "operationId": "5013a34733a9ab35d17a7fd182126e2e",
                "responses": {
                    "200": {
                        "description": "Account details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving account details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb-disconnect/{id}": {
            "delete": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Disconnect QuickBooks integration",
                "operationId": "bc579268c4dab0b7922bb059cc635ec8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "QuickBooks disconnected successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "QuickBooks disconnected successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error disconnecting QuickBooks"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_qb_counts": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Get counts of QuickBooks entities",
                "operationId": "40c34675fa815eaa8dd2539ce325a9be",
                "responses": {
                    "200": {
                        "description": "Counts retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "invoice_count": {
                                                    "type": "integer"
                                                },
                                                "customer_count": {
                                                    "type": "integer"
                                                },
                                                "estimate_count": {
                                                    "type": "integer"
                                                },
                                                "bill_count": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving counts"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_send_email_invoice": {
            "post": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Send a QuickBooks invoice via email",
                "operationId": "7d4e20ad32920be1e034fb0a562a67c1",
                "parameters": [
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address to send the invoice to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error sending invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_create_customer": {
            "post": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Create a QuickBooks customer",
                "operationId": "dbc28c11c40ac5517d239ffc8fe897e2",
                "parameters": [
                    {
                        "name": "customer_data",
                        "in": "query",
                        "description": "Customer data including name, email, phone, etc.",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Customer created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Customer created successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error creating customer"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_update_customer/{id}": {
            "put": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Update a QuickBooks customer",
                "operationId": "066f684e40f3ac23e7eaf546a5232866",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Customer ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_data",
                        "in": "query",
                        "description": "Updated customer data",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Customer updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Customer updated successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error updating customer"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_create_invoice": {
            "post": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Create a QuickBooks invoice",
                "operationId": "74d22fe96e9bc192354eb9fbc790035a",
                "parameters": [
                    {
                        "name": "customer_id",
                        "in": "query",
                        "description": "Customer ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invoice_data",
                        "in": "query",
                        "description": "Invoice data",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoice created successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error creating invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/qb_reports": {
            "post": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Generate QuickBooks reports",
                "operationId": "59ad6d17e3950f14ef481ceb3d172be5",
                "parameters": [
                    {
                        "name": "report_type",
                        "in": "query",
                        "description": "Type of report to generate",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for the report",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for the report",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report generated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error generating report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get_all_taxcode": {
            "get": {
                "tags": [
                    "QuickBooks Integration"
                ],
                "summary": "Get all QuickBooks tax codes",
                "operationId": "e8d9c378b818a426e8e9b760f1864e0b",
                "responses": {
                    "200": {
                        "description": "Tax codes retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Error retrieving tax codes"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/remove-qb-keys/{id}": {
            "post": {
                "tags": [
                    "Quickbooks Integration"
                ],
                "summary": "Disconnect QuickBooks for a user",
                "description": "Deletes every quickbook_keys row matching `user_id={id}`.",
                "operationId": "quickbooksRemoveKeys",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "User ID whose QuickBooks keys should be removed",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Disconnected",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Quickbooks diconnected."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-quote-templates": {
            "get": {
                "tags": [
                    "Quote Template"
                ],
                "summary": "Get all quote templates for the authenticated user's client",
                "operationId": "6ece19111682fe21d98d0ef9d3f918d4",
                "responses": {
                    "200": {
                        "description": "Templates retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "templates": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/save-quote-template": {
            "post": {
                "tags": [
                    "Quote Template"
                ],
                "summary": "Create a new quote template for the authenticated user's client",
                "operationId": "6b842c6a48c27d59feebb27c9a731d75",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "description": "Quote template fields (e.g. name, content). user_id and client_id are auto-populated from the authenticated user.",
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Template saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template saved successfully."
                                        },
                                        "template": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-quote-template/{id}": {
            "post": {
                "tags": [
                    "Quote Template"
                ],
                "summary": "Overwrite a saved quote template's content",
                "description": "Writes the quote being edited over a template already saved, so the same name keeps holding the header, note and footer it stands for. Only header, description and footer are updated — the name stays. A template belonging to another client (or an unknown id) answers 400, not 404.",
                "operationId": "8ec54f4548e926a992d7d61c4ccbbfcb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Quote template ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "header": {
                                        "description": "Quote header rich text (Quill markup)",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "description": {
                                        "description": "Quote note rich text",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "footer": {
                                        "description": "Quote footer rich text",
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Template updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template updated successfully."
                                        },
                                        "template": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Template not found for this client, or server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-quote-template/{id}": {
            "delete": {
                "tags": [
                    "Quote Template"
                ],
                "summary": "Delete a quote template",
                "description": "Drops a template the client no longer writes quotes from. Quotes already written from it keep the header, note and footer they were saved with. A template belonging to another client (or an unknown id) answers 400, not 404.",
                "operationId": "bf7b0d1d095564bfc85c932b2f68d99e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Quote template ID (must belong to the caller's client)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Template deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Template not found for this client, or server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining SMS credits for the authenticated user's client",
                "operationId": "ac8d22266cf584a20bc2cce0259a4294",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "unlimited": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "total_limit": {
                                                    "type": "integer",
                                                    "example": 1000
                                                },
                                                "total_used": {
                                                    "type": "integer",
                                                    "example": 500
                                                },
                                                "available_limit": {
                                                    "type": "integer",
                                                    "example": 500
                                                },
                                                "alert": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "Your SMS credits is nearing the limit, Purchase more limit form marketplace to ensure continued messaging capability."
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "excluded_from_subscription": {
                                                    "type": "string",
                                                    "example": "no"
                                                },
                                                "virtualNumber": {
                                                    "type": "integer",
                                                    "example": 1
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-remaining-emails": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining email credits for the authenticated user's client",
                "operationId": "db2924f7c6c29de7b84d651de588a07b",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email credits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "unlimited": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "total_limit": {
                                            "type": "integer",
                                            "example": 1000
                                        },
                                        "limit": {
                                            "type": "integer",
                                            "example": 1000
                                        },
                                        "total_used": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "email_count": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "available_limit": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "alert": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your marketing email is nearing the limit, Purchase more limit form marketplace."
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/emails-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining email credits for the authenticated user's client (alternative endpoint)",
                "operationId": "ae795cc10e9938c8809fc0d827ca99d3",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Email credits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "unlimited": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "total_limit": {
                                            "type": "integer",
                                            "example": 1000
                                        },
                                        "limit": {
                                            "type": "integer",
                                            "example": 1000
                                        },
                                        "total_used": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "email_count": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "available_limit": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "alert": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your marketing email is nearing the limit, Purchase more limit form marketplace."
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/quick-books-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get QuickBooks integration limits for the authenticated user's client",
                "operationId": "722ae3df67fac40131576a2db65519fc",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "QuickBooks limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "unlimited": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "total_limit": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total_used": {
                                                    "type": "null"
                                                },
                                                "available_limit": {
                                                    "type": "null"
                                                },
                                                "alert": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "QuickBooks is not purchased yet, click the purchase button to purchase."
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "excluded_from_subscription": {
                                                    "type": "string",
                                                    "example": "no"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/call-tracking-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get call tracking limits for the authenticated user's client",
                "operationId": "cd14aa25ac9b433176e898aeda43dccc",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call tracking limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "unlimited": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "total_limit": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total_used": {
                                                    "type": "null"
                                                },
                                                "available_limit": {
                                                    "type": "null"
                                                },
                                                "alert": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "Click the button below to purchase this feature and get the insights of each call you receive."
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 4
                                                },
                                                "excluded_from_subscription": {
                                                    "type": "string",
                                                    "example": "no"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/lead-contacts-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get lead contacts limits for the authenticated user's client",
                "operationId": "ed4e46b708b97a1b91612fe006f012bc",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lead contacts limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "unlimited": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "total_limit": {
                                            "type": "integer",
                                            "example": 1000
                                        },
                                        "total_used": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "available_limit": {
                                            "type": "integer",
                                            "example": 500
                                        },
                                        "alert": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your lead contacts is nearing the limit, Purchase more limit form marketplace."
                                        },
                                        "id": {
                                            "type": "integer",
                                            "example": 6
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        },
                                        "final_lead_id": {
                                            "type": "integer",
                                            "example": 0
                                        },
                                        "dates": {
                                            "properties": {
                                                "startDate": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01 00:00:00"
                                                },
                                                "endDate": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-12-31 23:59:59"
                                                }
                                            },
                                            "type": "object",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get Xero integration limits for the authenticated user's client",
                "operationId": "101712ddcafcdef0c8aa5c0aa3f1b3d2",
                "parameters": [
                    {
                        "name": "json",
                        "in": "query",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "unlimited": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "total_limit": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "total_used": {
                                                    "type": "null"
                                                },
                                                "available_limit": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "alert": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "Xero is not purchased yet, click the purchase button to purchase."
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 7
                                                },
                                                "excluded_from_subscription": {
                                                    "type": "string",
                                                    "example": "no"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-limit/{json}": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get team member limits for the authenticated user's client",
                "operationId": "3bb28752a864a26e0531126ff9480285",
                "parameters": [
                    {
                        "name": "json",
                        "in": "path",
                        "description": "Return as JSON response (true) or as array (false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "total_limit": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "total_used": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "available_limit": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "alert": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": ""
                                                },
                                                "id": {
                                                    "type": "integer",
                                                    "example": 24
                                                },
                                                "excluded_from_subscription": {
                                                    "type": "string",
                                                    "example": "no"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client-package-item-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get client package item limits for the authenticated user's client",
                "operationId": "b343ea3c1d48687a6df26ed70f0c0b4c",
                "responses": {
                    "200": {
                        "description": "Client package item limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "limit": {
                                            "properties": {
                                                "remaining_emails": {
                                                    "type": "object"
                                                },
                                                "remaining_sms": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "product": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "example": "SMS Credits"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-form-builder-limits": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get form builder limits for the authenticated user's client",
                "operationId": "1d1da515eee3dfda724f7df1d2f92b4f",
                "responses": {
                    "200": {
                        "description": "Form builder limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        },
                                        "limit": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "forms": {
                                            "type": "integer",
                                            "example": 5
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-custom-field-limits": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get custom field limits for the authenticated user's client",
                "operationId": "5666b7cc379d998afc2b18475d406fb8",
                "responses": {
                    "200": {
                        "description": "Custom field limits information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        },
                                        "limit": {
                                            "type": "integer",
                                            "example": 20
                                        },
                                        "custom_fields": {
                                            "type": "integer",
                                            "example": 10
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-feature-integration/{slug}": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Check if a feature is integrated for the authenticated user's client",
                "operationId": "94fe18a14262a81d3dbe649b682d2c96",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Slug of the feature to check",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "email_marketing"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feature integration information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string",
                                            "example": "no"
                                        },
                                        "limit": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "is_pro": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "pageVisitorConfigured": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-remaining-limit-by-slug/{slug}": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining package limit by slug",
                "operationId": "91f5bb0c0a7045e30f7a23d0ce90ec96",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Package item slug (e.g. team_member, lead_management, email_marketing)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "clientId",
                        "in": "query",
                        "description": "Optional client ID; defaults to authenticated user's client",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Remaining limit retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining package limit by slug",
                "operationId": "c33101507b927dda896b064fe2cebbc8",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Package item slug (e.g. team_member, lead_management, email_marketing)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "clientId",
                        "in": "query",
                        "description": "Optional client ID; defaults to authenticated user's client",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Remaining limit retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/webhook-limit": {
            "get": {
                "tags": [
                    "Restrictions"
                ],
                "summary": "Get remaining webhook execution limit for the authenticated client",
                "operationId": "901a51b88eb2baf008630556b87c032c",
                "responses": {
                    "200": {
                        "description": "Webhook limit information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "unlimited": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "total_limit": {
                                            "type": "integer"
                                        },
                                        "total_used": {
                                            "type": "integer"
                                        },
                                        "available_limit": {
                                            "type": "integer"
                                        },
                                        "alert": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "excluded_from_subscription": {
                                            "type": "string"
                                        },
                                        "final_lead_id": {
                                            "type": "integer"
                                        },
                                        "dates": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/role": {
            "get": {
                "tags": [
                    "Roles"
                ],
                "summary": "Get all roles with their permissions",
                "operationId": "27df314390373447ea339eaa0251cbc4",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "roles": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "permissions_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "role_wise_permissions": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Roles"
                ],
                "summary": "Update an existing role",
                "operationId": "88a0ee319c425c89e36268a3d3b149ae",
                "parameters": [
                    {
                        "name": "role",
                        "in": "query",
                        "description": "Name of the role to update",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "manager"
                        }
                    },
                    {
                        "name": "permission",
                        "in": "query",
                        "description": "Array of permissions to assign to the role",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Role updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Role Updated Successfully"
                                        },
                                        "role": {
                                            "type": "object"
                                        },
                                        "allotted": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "user_info": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Roles"
                ],
                "summary": "Create a new role",
                "operationId": "22f4587ea6b8847ee58a2b64f047c49d",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the role",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "manager"
                        }
                    },
                    {
                        "name": "permission",
                        "in": "query",
                        "description": "Array of permissions to assign to the role",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Role created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Role Added Successfully"
                                        },
                                        "role": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Roles"
                ],
                "summary": "Delete a role",
                "operationId": "ae7f246ce0c670a24c9c8e028929ec1f",
                "parameters": [
                    {
                        "name": "role",
                        "in": "query",
                        "description": "Name of the role to delete",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "manager"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Role deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Role Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user-role": {
            "get": {
                "tags": [
                    "Roles"
                ],
                "summary": "Get user roles with their permissions",
                "operationId": "27acda4abea69604325484dc3f379387",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "roles": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "permissions_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "role_wise_permissions": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/role-type-delete-multiple": {
            "post": {
                "tags": [
                    "Roles"
                ],
                "summary": "Delete multiple roles",
                "operationId": "eee55c21ad3521dd8437b15bdde3ea20",
                "parameters": [
                    {
                        "name": "ids",
                        "in": "query",
                        "description": "Array of role IDs to delete",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Roles deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Role Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-scheduled-campaign-list": {
            "post": {
                "tags": [
                    "Send Scheduled Campaign"
                ],
                "summary": "Get list of scheduled campaigns as a DataTables JSON response",
                "operationId": "2ea2d334f59f2c91e52bf4b581f7e968",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Campaign type (e.g. sms, email, mms)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "sms",
                                "email",
                                "mms"
                            ]
                        }
                    },
                    {
                        "name": "template_id",
                        "in": "query",
                        "description": "Template ID associated with the campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON of scheduled campaigns"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-scheduled-campaign/{id}": {
            "get": {
                "tags": [
                    "Send Scheduled Campaign"
                ],
                "summary": "Cancel a scheduled campaign by ID",
                "operationId": "384253a9ca5098ac2ff613c3bfc1418f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the scheduled campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled campaign cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Scheduled campaign cancelled successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-scheduled-contacts": {
            "post": {
                "tags": [
                    "Send Scheduled Campaign"
                ],
                "summary": "Get contacts associated with a scheduled campaign",
                "operationId": "11f98f228711615a0bb0c3ac6c6f35a0",
                "parameters": [
                    {
                        "name": "send_campaign_id",
                        "in": "query",
                        "description": "ID of the scheduled campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON of scheduled contacts"
                    },
                    "404": {
                        "description": "Record not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-scheduled-campaign-single-contact": {
            "get": {
                "tags": [
                    "Send Scheduled Campaign"
                ],
                "summary": "Cancel a single contact from a scheduled campaign",
                "operationId": "cfa5399182b05974627a6ef0ab45170b",
                "parameters": [
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "description": "ID of the individual campaign entry to remove",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "send_scheduled_campaign_id",
                        "in": "query",
                        "description": "ID of the parent scheduled campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact removed from scheduled campaign successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "scheduledCampaignDeleted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contact removed from scheduled campaign successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled campaign or campaign ID not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-scheduled-campaign-multiple-contact": {
            "post": {
                "tags": [
                    "Send Scheduled Campaign"
                ],
                "summary": "Cancel multiple contacts from a scheduled campaign",
                "operationId": "f6f1fe7423f6736fe3a07f8d2bbcf767",
                "parameters": [
                    {
                        "name": "campaign_ids",
                        "in": "query",
                        "description": "Array of campaign IDs to remove",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "send_scheduled_campaign_id",
                        "in": "query",
                        "description": "ID of the parent scheduled campaign",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contacts removed from scheduled campaign successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "scheduledCampaignDeleted": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Contacts removed from scheduled campaign successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scheduled campaign not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/seo-report": {
            "get": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Get a list of SEO reports",
                "operationId": "dbc78b5e9c19839d07273d6ea4b068ef",
                "responses": {
                    "200": {
                        "description": "List of SEO reports"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Create a new SEO report",
                "operationId": "636f9678de0e3f8e583e8d5fb0998422",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Report subject",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Report message",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cc_emails",
                        "in": "query",
                        "description": "CC email addresses",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "files[]",
                        "in": "query",
                        "description": "Report files",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "file"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SEO report created successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/seo-report/data-table": {
            "post": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Get SEO reports for data table",
                "operationId": "a76ecf4f6be9a3b15135ab56f9e4ac7a",
                "parameters": [
                    {
                        "name": "email_sent",
                        "in": "query",
                        "description": "Filter by email sent status",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter by start date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter by end date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Filter by user ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SEO reports data for data table"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/seo-report/{id}": {
            "get": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Get a specific SEO report",
                "operationId": "b0b4019897bc4697748d99a02e04c12d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SEO report details"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "SEO report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Send a SEO report via email",
                "operationId": "67bbe10e6a21209064626434ba729ffb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SEO report sent successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "SEO report not found"
                    },
                    "500": {
                        "description": "Error sending report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Delete a SEO report",
                "operationId": "96a1cf0bcb59ef2b50941f8f102c92c6",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report deleted successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "SEO report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/seo_report_tracking/{id}": {
            "get": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Track when a SEO report is viewed",
                "operationId": "8d3b8b9c7b76cd6b98c05dac8873e54b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report tracking updated"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SEO report not found"
                    }
                }
            }
        },
        "/api/seo-report/download-attachment": {
            "get": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "Download a SEO report attachment",
                "operationId": "707dd438cee302ec669891f277ca3259",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Attachment index",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File download"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/report_view/seo/{id}": {
            "get": {
                "tags": [
                    "SEO Reports"
                ],
                "summary": "View a SEO report",
                "operationId": "ceb079bfe2622d1c49ceeedf0104f719",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SEO report ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SEO report details with files",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "files": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "report_file_name": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Report not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/short-url": {
            "get": {
                "tags": [
                    "Short URLs"
                ],
                "summary": "Get all short URLs",
                "operationId": "b9526c696e6478e20673e37a5278ccd2",
                "responses": {
                    "200": {
                        "description": "List of all short URLs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "shortUrls": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Short URLs"
                ],
                "summary": "Create a new short URL",
                "operationId": "09308968fb8527ecb91ee1677e289ed8",
                "parameters": [
                    {
                        "name": "url",
                        "in": "query",
                        "description": "URL to be shortened",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "https://example.com/long-url-to-be-shortened"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Short URL created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Short Url added successfully."
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/short-url/{id}": {
            "get": {
                "tags": [
                    "Short URLs"
                ],
                "summary": "Get a specific short URL by ID",
                "operationId": "b3f557d77afd41c458e8dc668774368a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the short URL",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Short URL details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Short URL not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-short-url/{code}": {
            "get": {
                "tags": [
                    "Short URLs"
                ],
                "summary": "Get a short URL by its code",
                "operationId": "aed068f6b3ee7341837156502950d57e",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "description": "Code of the short URL",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "abc123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Short URL found successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Short Url has been Found sucessfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Short URL not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Short Url is not Found"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/short-url/{short_url}": {
            "put": {
                "tags": [
                    "Short URL"
                ],
                "summary": "Update a short URL (resource update – placeholder, not currently implemented)",
                "operationId": "eb430646bb1ac39b4d2067c5afd251b6",
                "parameters": [
                    {
                        "name": "short_url",
                        "in": "path",
                        "description": "Short URL ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Short URL"
                ],
                "summary": "Delete a short URL (resource destroy – placeholder, not currently implemented)",
                "operationId": "af5f74745a698644ab3a45aee1dc45ff",
                "parameters": [
                    {
                        "name": "short_url",
                        "in": "path",
                        "description": "Short URL ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign": {
            "get": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Get all SMS campaigns for the authenticated user's client",
                "operationId": "2dbb74d560441e5737c2c7b12751b224",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "user_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "sms_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "lead_id": {
                                                "type": "integer",
                                                "example": 100
                                            },
                                            "to_mobile": {
                                                "type": "string",
                                                "example": "+1234567890"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Create a new SMS campaign",
                "operationId": "f1e7b3e7c06a1ed1b7de8c818daac474",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient mobile number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Added Successfully"
                                        },
                                        "sms_campaign": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 100
                                                },
                                                "to_mobile": {
                                                    "type": "string",
                                                    "example": "+1234567890"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign/data-table/get": {
            "post": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Get SMS campaigns data for DataTables",
                "description": "Display a listing of the resource for DataTables.",
                "operationId": "d279bcdf6b388a233f96951feee346da",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "sms_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "example": 100
                                                    },
                                                    "to_mobile": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign/{id}": {
            "get": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Get a specific SMS campaign by ID",
                "operationId": "113c5f335ff05924e7f5ea419e0adf09",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "client_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "sms_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "lead_id": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "to_mobile": {
                                            "type": "string",
                                            "example": "+1234567890"
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No SMS Campaign Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Update a specific SMS campaign",
                "operationId": "d159ee24235b4c8e0981dce281a8ff95",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "to_mobile",
                        "in": "query",
                        "description": "Recipient mobile number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Updated Successfully"
                                        },
                                        "sms_campaign": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "lead_id": {
                                                    "type": "integer",
                                                    "example": 100
                                                },
                                                "to_mobile": {
                                                    "type": "string",
                                                    "example": "+1234567890"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Delete a specific SMS campaign",
                "operationId": "3426ec7b7815b310c1f488987ff574d1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign/get-list-sms-campaigns/{id}": {
            "post": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Get list of SMS campaigns by SMS ID",
                "description": "Get list of SMS campaigns by SMS ID",
                "operationId": "dc1a65cac1f15a80e4e915f8d9b7039a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "sms_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "example": 100
                                                    },
                                                    "to_mobile": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "example": "john.doe@example.com"
                                                    },
                                                    "sent_time": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "No search results found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No search results found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign/get-sms-campaigns-report-data/{id}": {
            "post": {
                "tags": [
                    "SMS Campaign"
                ],
                "summary": "Get SMS campaign report data for a given SMS",
                "description": "Returns DataTables-formatted SMS campaign rows for the authenticated user's client, scoped to the given SMS ID. Supports optional filters: start_date, end_date, and status (queued|delivered|failed|scheduled).",
                "operationId": "58e031b991931eb8d20dd1a753dabde5",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Filter campaigns created on or after this date (Y-m-d H:i:s)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Filter campaigns created on or before this date (Y-m-d H:i:s)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by send status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "queued",
                                "delivered",
                                "failed",
                                "scheduled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "sms_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "example": 100
                                                    },
                                                    "to_mobile": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "example": "john.doe@example.com"
                                                    },
                                                    "sent_status": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "schedule_time": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign-insert-loop": {
            "get": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Get all SMS campaign insert loops for the authenticated user's client",
                "operationId": "e12eb8a02f88963337d282e5d59c3b5a",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "user_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "sms_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "last_lead_id": {
                                                "type": "integer",
                                                "example": 100
                                            },
                                            "filters": {
                                                "type": "string",
                                                "example": "[]"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Create a new SMS campaign insert loop",
                "operationId": "7b72dad33da4f86247f16654030714d2",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "last_lead_id",
                        "in": "query",
                        "description": "Last lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "description": "Filters as array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign Insert Loop created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Insert Loop Added Successfully"
                                        },
                                        "sms_campaign_insert_loop": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_lead_id": {
                                                    "type": "integer",
                                                    "example": 100
                                                },
                                                "filters": {
                                                    "type": "string",
                                                    "example": "[]"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign-insert-loop/data-table/get": {
            "post": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Get SMS campaign insert loops data for DataTables",
                "description": "Display a listing of the resource for DataTables.",
                "operationId": "81ea513b01cda433ba3a95619624c37d",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "sms_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "last_lead_id": {
                                                        "type": "integer",
                                                        "example": 100
                                                    },
                                                    "filters": {
                                                        "type": "string",
                                                        "example": "[]"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-campaign-insert-loop/{id}": {
            "get": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Get a specific SMS campaign insert loop by ID",
                "operationId": "44b0b96ee09182f2a43e82dbd247eda3",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign Insert Loop ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "client_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "sms_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "last_lead_id": {
                                            "type": "integer",
                                            "example": 100
                                        },
                                        "filters": {
                                            "type": "string",
                                            "example": "[]"
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign Insert Loop not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No SMS Campaign Insert Loop Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Update a specific SMS campaign insert loop",
                "operationId": "bc1dc1e1b95a67c5eb13edecd3ecdea1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign Insert Loop ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "last_lead_id",
                        "in": "query",
                        "description": "Last lead ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "filters",
                        "in": "query",
                        "description": "Filters as array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign Insert Loop updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Insert Loop Updated Successfully"
                                        },
                                        "sms_campaign_insert_loop": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_lead_id": {
                                                    "type": "integer",
                                                    "example": 100
                                                },
                                                "filters": {
                                                    "type": "string",
                                                    "example": "[]"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign Insert Loop not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS Campaign Insert Loop"
                ],
                "summary": "Delete a specific SMS campaign insert loop",
                "operationId": "aa655be5183b1f6fce2e725264a597b9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Campaign Insert Loop ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Campaign Insert Loop deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Insert Loop Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Campaign Insert Loop not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Campaign Insert Loop Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits/get-available/{id}": {
            "get": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Get available SMS credits and message history for a lead",
                "operationId": "8814d1e0c1706636fc1da36c64307f77",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the lead",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Available SMS credits and message data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "credits_available": {
                                            "type": "number"
                                        },
                                        "messageData": {
                                            "type": "object"
                                        },
                                        "virtualNumber": {
                                            "type": "integer"
                                        },
                                        "allow_postpaid_sms": {
                                            "type": "integer"
                                        },
                                        "sms_charge": {
                                            "type": "number"
                                        },
                                        "plan_status": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits/data-table/get": {
            "post": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Get SMS credits as a DataTables response",
                "operationId": "fcda87361db10075044dc6006af9a0b1",
                "responses": {
                    "200": {
                        "description": "SMS credits retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits": {
            "get": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Get list of SMS credits for the authenticated user's client",
                "operationId": "48dcabe01f2d3a96edd4e8b520a46e38",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Add SMS credits for a user",
                "operationId": "f0e3467e3a2a21fb9e9e0621d18a80db",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user receiving the credits",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "credits",
                        "in": "query",
                        "description": "Number of SMS credits to add",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credits added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credits Added Successfully"
                                        },
                                        "sms_credits": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or invalid user"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits/{sms_credit}": {
            "get": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Display the specified SMS credit record",
                "operationId": "5c1893d29430957a01adef26d9ddf7bc",
                "parameters": [
                    {
                        "name": "sms_credit",
                        "in": "path",
                        "description": "ID of the SMS credit record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "No SMS Credit Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Update the specified SMS credit record",
                "operationId": "a0ef00cbabac18486e1d07b58f8d117d",
                "parameters": [
                    {
                        "name": "sms_credit",
                        "in": "path",
                        "description": "ID of the SMS credit record to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user the credits belong to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "credits",
                        "in": "query",
                        "description": "Updated number of SMS credits",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credit updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credit Updated Successfully"
                                        },
                                        "sms_credits": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Delete the specified SMS credit record",
                "operationId": "6c868e5a687f6178a3adec1d975f564a",
                "parameters": [
                    {
                        "name": "sms_credit",
                        "in": "path",
                        "description": "ID of the SMS credit record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credit deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credit Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS Credit Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-sms-credits-and-numbers": {
            "get": {
                "tags": [
                    "SMS Credits"
                ],
                "summary": "Get available SMS credits and the count of SMS-capable virtual numbers",
                "operationId": "f228cb52f737fc0352ec7b81b6013159",
                "responses": {
                    "200": {
                        "description": "SMS credits and virtual number count retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "credits_available": {
                                            "type": "number"
                                        },
                                        "virtualNumber": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits-used/data-table/get": {
            "post": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Get SMS credits used as a DataTables response",
                "operationId": "20e0750b11058405ba96a2b7b19ebec8",
                "responses": {
                    "200": {
                        "description": "SMS credits used retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits-used": {
            "get": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Get list of SMS credits used for the authenticated user's client",
                "operationId": "5a68bd0caff150014f28b5b3f5c85920",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Deduct SMS credits used for a user",
                "operationId": "5ec260f66e3c742965117f8d99ba960a",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user whose credits are being used",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "credits_used",
                        "in": "query",
                        "description": "Number of SMS credits used",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credits used added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credits Used Added Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or invalid user"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-credits-used/{sms_credits_used}": {
            "get": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Display the specified SMS credits used record",
                "operationId": "66d62b708efaed5d749e60dbb587ff9a",
                "parameters": [
                    {
                        "name": "sms_credits_used",
                        "in": "path",
                        "description": "ID of the SMS credits used record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation"
                    },
                    "404": {
                        "description": "No SMS Credits Used Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Update the specified SMS credits used record",
                "operationId": "3eed843a123274017d12c0f177ade717",
                "parameters": [
                    {
                        "name": "sms_credits_used",
                        "in": "path",
                        "description": "ID of the SMS credits used record to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user whose credits are being updated",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "credits_used",
                        "in": "query",
                        "description": "Updated number of SMS credits used",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credits used updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credit Used Updated Successfully"
                                        },
                                        "sms_credits_used": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS Credits Used"
                ],
                "summary": "Delete the specified SMS credits used record",
                "operationId": "0e9cbcebd69b809c4fa837849d076991",
                "parameters": [
                    {
                        "name": "sms_credits_used",
                        "in": "path",
                        "description": "ID of the SMS credits used record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS credit used deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Credit Used Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS Credit Used Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms": {
            "get": {
                "tags": [
                    "SMS"
                ],
                "summary": "Get list of SMS templates and phone numbers",
                "operationId": "07d64488da87cbaa458b7f75aad012f8",
                "responses": {
                    "200": {
                        "description": "List of SMS templates and phone numbers retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "smsTemplate": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "fromNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Create a new SMS template",
                "operationId": "8040227756ed4c361243eb8da4080807",
                "parameters": [
                    {
                        "name": "description",
                        "in": "query",
                        "description": "SMS content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "encoding",
                        "in": "query",
                        "description": "SMS encoding",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "no_of_sms",
                        "in": "query",
                        "description": "Number of SMS",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from_name",
                        "in": "query",
                        "description": "Sender name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 11
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template created successfully"
                                        },
                                        "sms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/data-table/get": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Get SMS data for datatable",
                "operationId": "b47a0bf9ec13e8be59c13ef3b77ad5a3",
                "responses": {
                    "200": {
                        "description": "SMS data retrieved successfully for datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "phoneNumber": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "sms_credits": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/{id}": {
            "get": {
                "tags": [
                    "SMS"
                ],
                "summary": "Get a specific SMS template",
                "operationId": "3fbf733530ac2a9e5691491a248f7db2",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS template retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "sms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS"
                ],
                "summary": "Update an existing SMS template",
                "operationId": "467560c6999154b3b50dff9cf22e14c1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "SMS content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "encoding",
                        "in": "query",
                        "description": "SMS encoding",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "no_of_sms",
                        "in": "query",
                        "description": "Number of SMS",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from_name",
                        "in": "query",
                        "description": "Sender name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 11
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS template updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template updated successfully"
                                        },
                                        "sms": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS"
                ],
                "summary": "Delete an SMS template",
                "operationId": "acdc095468bfa8f8cc1842b34930ad99",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS template deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/{id}/get-credits-required": {
            "get": {
                "tags": [
                    "SMS"
                ],
                "summary": "Get credits required for an SMS",
                "operationId": "ec5db79de67e3fa110d3383ae5c85940",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Credits required retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "credits_required": {
                                            "type": "integer",
                                            "example": 1
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/check-before-send": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Check before sending an SMS",
                "operationId": "cbcf210a20017c0ac9538f4179f28060",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "Lead IDs to send SMS to",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Check completed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Check completed successfully"
                                        },
                                        "credits_required": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "credits_available": {
                                            "type": "integer",
                                            "example": 100
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not enough credits",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Not enough credits"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/send": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Send SMS to leads",
                "operationId": "e67f1507e04501200ff5b076430e5049",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS template ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lead_ids",
                        "in": "query",
                        "description": "Lead IDs to send SMS to",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "scheduled_date",
                        "in": "query",
                        "description": "Date to schedule SMS",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not enough credits or other error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Not enough credits"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "SMS template not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS template not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/send-to-single-lead": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Send SMS to a single lead",
                "operationId": "085a25198d71f410996d57d6e14d2ca0",
                "parameters": [
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID to send SMS to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "SMS message content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "Sender phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS sent successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Not enough credits or other error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Not enough credits"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Lead not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms/lead-search": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Search for leads to send SMS to",
                "operationId": "49c8cd086955ec6561f21b3385319c5a",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-index-update": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Update SMS template index order",
                "operationId": "5a9fb49a05694ec0e97815f9026752cf",
                "parameters": [
                    {
                        "name": "sms_data",
                        "in": "query",
                        "description": "Array of SMS IDs and their new index positions",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "index": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS template indexes updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-sms-to-selected-leads": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "Send an existing SMS template (or a custom message) to a set of selected leads",
                "description": "Validates the requested credit usage against the client's SMS balance and queues delivery. When isCustomMsg is true an existing sms_id is used; otherwise description/encoding/no_of_sms are required to create a new SMS record.",
                "operationId": "ee55e2d4a4c300a80f1dcc9cd384780e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "isCustomMsg": {
                                        "description": "Use an existing SMS template (true) or create a new one (false)",
                                        "type": "boolean"
                                    },
                                    "sms_id": {
                                        "description": "Existing SMS ID (required when isCustomMsg=true)",
                                        "type": "integer"
                                    },
                                    "lead_id": {
                                        "description": "Lead IDs to send the SMS to (required when isCustomMsg=true)",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "description": {
                                        "description": "SMS body (required when isCustomMsg=false)",
                                        "type": "string"
                                    },
                                    "encoding": {
                                        "description": "SMS encoding (e.g. GSM_7BIT, UCS2)",
                                        "type": "string"
                                    },
                                    "no_of_sms": {
                                        "description": "Number of SMS segments per recipient",
                                        "type": "integer"
                                    },
                                    "from_number": {
                                        "description": "Sender phone number",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "SMS dispatch result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-sms-list": {
            "post": {
                "tags": [
                    "SMS"
                ],
                "summary": "List SMS records for the authenticated user's client with search, filter and pagination",
                "operationId": "9fdc072755a5b77154a6920a0f9a3311",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "limit": {
                                        "description": "Records per page (default 4)",
                                        "type": "integer"
                                    },
                                    "search_text": {
                                        "description": "Free-text search across SMS fields",
                                        "type": "string"
                                    },
                                    "created_by": {
                                        "description": "Filter by creator user ID",
                                        "type": "integer"
                                    },
                                    "is_custom_msg": {
                                        "description": "0 for standard SMS, 1 for custom messages",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Paginated SMS list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-tracking": {
            "get": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Get all SMS tracking records",
                "operationId": "ab505d99bb2f1018fd3763ea0ef807a7",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "user_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "client_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "sms_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "lead_id": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "phone_number": {
                                                "type": "string",
                                                "example": "+1234567890"
                                            },
                                            "delivered": {
                                                "type": "integer",
                                                "example": 1
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "example": "2023-01-01T00:00:00.000000Z"
                                            },
                                            "updated_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "example": "2023-01-01T00:00:00.000000Z"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Create a new SMS tracking record",
                "operationId": "9e672ace6cade6f56b5822897b8cda7e",
                "parameters": [
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "sms_user_id",
                        "in": "query",
                        "description": "SMS User ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Tracking Added Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Tracking Added Successfully"
                                        },
                                        "sms_tracking": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "phone_number": {
                                                    "type": "string",
                                                    "example": "+1234567890"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01T00:00:00.000000Z"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01T00:00:00.000000Z"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-tracking/data-table/get": {
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Get SMS tracking records for DataTables",
                "description": "Display a listing of the resource for DataTables.",
                "operationId": "077dbb5b61cf197eeb2da32171b39e09",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "sms_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "lead_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "phone_number": {
                                                        "type": "string",
                                                        "example": "+1234567890"
                                                    },
                                                    "delivered": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01T00:00:00.000000Z"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01T00:00:00.000000Z"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-tracking/{id}": {
            "get": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Get a specific SMS tracking record",
                "operationId": "e747f31c4173164173551be2059add2e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Tracking ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "client_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "sms_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "lead_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "phone_number": {
                                            "type": "string",
                                            "example": "+1234567890"
                                        },
                                        "delivered": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2023-01-01T00:00:00.000000Z"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2023-01-01T00:00:00.000000Z"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "No SMS Tracking Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Update a specific SMS tracking record",
                "operationId": "e6c858cafb02f2dcdcdde5ca182e5459",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Tracking ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "sms_id",
                        "in": "query",
                        "description": "SMS ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "sms_user_id",
                        "in": "query",
                        "description": "SMS User ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Tracking Updated Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Tracking Updated Successfully"
                                        },
                                        "sms_tracking": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "sms_user_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "phone_number": {
                                                    "type": "string",
                                                    "example": "+1234567890"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01T00:00:00.000000Z"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01T00:00:00.000000Z"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Delete a specific SMS tracking record",
                "operationId": "2214636f3354b20f057b8cd00fc97b54",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SMS Tracking ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS Tracking Deleted Successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Tracking Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "SMS Tracking Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-reply": {
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Handle SMS reply from Twilio webhook",
                "description": "Handle SMS reply from Twilio webhook",
                "operationId": "976b9a70e5c479ba2f2e8facc1664b98",
                "parameters": [
                    {
                        "name": "From",
                        "in": "query",
                        "description": "Phone number that sent the SMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "To",
                        "in": "query",
                        "description": "Phone number that received the SMS",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "Body",
                        "in": "query",
                        "description": "SMS message body",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "This is a reply message"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS reply processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS reply processed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error processing SMS reply"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-sms-reply-list": {
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Get list of SMS replies",
                "operationId": "9784e6c213831e538764f89b158777ad",
                "responses": {
                    "200": {
                        "description": "List of SMS replies retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/received-sms-reply-send": {
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Send SMS reply to a received message",
                "description": "Send SMS reply to a received message",
                "operationId": "e949b9303da0965d00997598eda88b0c",
                "parameters": [
                    {
                        "name": "from_number",
                        "in": "query",
                        "description": "Phone number to send from",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "to_number",
                        "in": "query",
                        "description": "Phone number to send to",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+1234567890"
                        }
                    },
                    {
                        "name": "encoding",
                        "in": "query",
                        "description": "SMS encoding",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "UTF-8"
                        }
                    },
                    {
                        "name": "no_of_sms",
                        "in": "query",
                        "description": "Number of SMS segments",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "sms_tracking_id",
                        "in": "query",
                        "description": "SMS Tracking ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "SMS message body",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "This is a reply message"
                        }
                    },
                    {
                        "name": "lead_id",
                        "in": "query",
                        "description": "Lead ID",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SMS has been sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "SMS has been sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error or Not enough credits"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-sms-schedule/{id}": {
            "get": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Cancel a scheduled SMS",
                "description": "Soft-deletes the SmsTracking row and, if a SmsCampaign references it via sms_tracking_id, also soft-deletes that campaign row.",
                "operationId": "cancelSmsSchedule",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "SmsTracking row ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 42
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "SMS Schedule Cancelled Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "SmsTracking row not found, or save failed. Body is either {'message':'No Data Found'} or {'message':'Something Went Wrong.'}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Data Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/sms-conversation-by-number": {
            "get": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "The SMS conversation with one phone number (for messages with no lead)",
                "description": "For the inbox reply modal when a message's sender matches no lead contact. Matches on the number's last 10 digits across inbound (receive_from_number) and outbound (phone_number) rows, and returns the same messageData shape as the lead thread, keyed by the number itself. from_number is the number previously replied from, falling back to any of the client's SMS-capable numbers.",
                "operationId": "b384e96f91dc0f720504437ab55fa6c7",
                "parameters": [
                    {
                        "name": "number",
                        "in": "query",
                        "description": "The other party's phone number",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+447700900123"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversation keyed by the queried number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "messageData": {
                                            "description": "Map of the queried number => {from_number, messages}",
                                            "type": "object",
                                            "additionalProperties": {
                                                "properties": {
                                                    "from_number": {
                                                        "description": "Number to send a reply from (nullable when the client has no SMS-capable number)",
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "messages": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "from_message": {
                                                                    "description": "Outbound message text",
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "receive_message": {
                                                                    "description": "Inbound message text",
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "delivered": {
                                                                    "type": "integer",
                                                                    "nullable": true
                                                                },
                                                                "received": {
                                                                    "type": "integer",
                                                                    "nullable": true
                                                                },
                                                                "created_at": {
                                                                    "description": "Client-timezone timestamp",
                                                                    "type": "string"
                                                                },
                                                                "send_user": {
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "send_user_id": {
                                                                    "type": "integer",
                                                                    "nullable": true
                                                                },
                                                                "send_user_image": {
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "from_number": {
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "schedule_time": {
                                                                    "type": "string",
                                                                    "nullable": true
                                                                },
                                                                "sms_tacking_id": {
                                                                    "type": "integer"
                                                                },
                                                                "received_name": {
                                                                    "description": "Always the queried number (no contact name is known)",
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/link-inbound-sms-to-lead": {
            "post": {
                "tags": [
                    "SMS Tracking"
                ],
                "summary": "Attach a lead to inbound SMS from an unknown number",
                "description": "The inbox's \"Add lead\" action. Every unlinked inbound message from the same sender number (matched on its last 10 digits) is attached to the lead, so the whole conversation moves across — not only the clicked row.",
                "operationId": "de4837eafddba5ca80e0bd45d3ffd647",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "sms_tracking_id",
                                    "lead_id"
                                ],
                                "properties": {
                                    "sms_tracking_id": {
                                        "description": "The clicked inbound message",
                                        "type": "integer"
                                    },
                                    "lead_id": {
                                        "description": "Lead to attach (must belong to the caller's client)",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Messages linked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Lead linked successfully."
                                        },
                                        "linked_messages": {
                                            "description": "How many messages were attached",
                                            "type": "integer",
                                            "example": 3
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, SMS message or lead not found for this client, or the message has no sender number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/status": {
            "get": {
                "tags": [
                    "Status"
                ],
                "summary": "Display a listing of statuses",
                "operationId": "a27f26e35bade06d4054143612379672",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "status": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Status"
                ],
                "summary": "Store a newly created status",
                "operationId": "902401d17ea4b8103fba4a72c17c6db1",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the status",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "In Progress"
                        }
                    },
                    {
                        "name": "for_module",
                        "in": "query",
                        "description": "Module for which the status is created",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "project_tasks"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Status Added Successfully"
                                        },
                                        "status": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/status/{status}": {
            "get": {
                "tags": [
                    "Status"
                ],
                "summary": "Get a single status by ID",
                "operationId": "showStatus",
                "parameters": [
                    {
                        "name": "status",
                        "in": "path",
                        "description": "Status ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status row",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No status found for the given ID",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Status Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/status/{id}": {
            "put": {
                "tags": [
                    "Status"
                ],
                "summary": "Update the specified status",
                "operationId": "dba902708b03b53b066db36628c436b0",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the status",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the status",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Completed"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Status Updated Successfully"
                                        },
                                        "status": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Status not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Status"
                ],
                "summary": "Remove the specified status",
                "operationId": "d00f651b4e7b17b1ad41a346b6b6126b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the status",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Status Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Status not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "error": {
                                            "type": "string",
                                            "example": "Status Not Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/status-list": {
            "post": {
                "tags": [
                    "Status"
                ],
                "summary": "Get status list by module",
                "operationId": "d06f8837ecd5268ceaacd9841e05ad3d",
                "parameters": [
                    {
                        "name": "for_module",
                        "in": "query",
                        "description": "Module for which to get status list",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "project_tasks"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status list retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "status": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-status-order": {
            "post": {
                "tags": [
                    "Status"
                ],
                "summary": "Update status order",
                "operationId": "fda670e29ceb58c8e36db28dc2e30e72",
                "parameters": [
                    {
                        "name": "status_list",
                        "in": "query",
                        "description": "List of statuses with their new order",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "status_id": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "index": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status order updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "result": {
                                            "type": "array",
                                            "items": {
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-stripe-account": {
            "get": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Get Stripe account details for the authenticated user's client",
                "operationId": "8580e10b3fb256f1182d77888f5f128f",
                "responses": {
                    "200": {
                        "description": "Stripe details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Stripe settings has been fetch Successfully"
                                        },
                                        "stripe_user_id": {
                                            "type": "string",
                                            "example": "acct_123456789"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-stripe-account-invoice": {
            "get": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Get Stripe account details for invoice processing",
                "operationId": "a74e646f810364d09f5fe987a3e1e2d1",
                "responses": {
                    "200": {
                        "description": "Stripe details for invoice retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Stripe settings has been fetch Successfully"
                                        },
                                        "stripe_user_id": {
                                            "type": "string",
                                            "example": "acct_123456789"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/stripe/save-details": {
            "post": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Store Stripe account details after OAuth authorization",
                "operationId": "bbd6f6268274087231107cdb82828f5f",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code received from Stripe OAuth",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Stripe details saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Stripe settings has been saved Successfully"
                                        },
                                        "stripe_user_id": {
                                            "type": "string",
                                            "example": "acct_123456789"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or failed to save"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-stripe-details": {
            "post": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Delete connected Stripe account",
                "operationId": "9e161a9e0a090c08c345a4d69571bea1",
                "responses": {
                    "200": {
                        "description": "Stripe account deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Stripe Account deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/stripe-invoice-subscription-update": {
            "post": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Handle Stripe subscription webhook events",
                "operationId": "ce226b9f02a68db5aedd50d2ac269490",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Event type from Stripe webhook",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "customer.subscription.deleted"
                        }
                    },
                    {
                        "name": "data",
                        "in": "query",
                        "description": "Event data from Stripe webhook",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/connected-stripe-webhook": {
            "post": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Handle Stripe payment webhook events",
                "operationId": "268094723f04ccbff7b471ffb53af75c",
                "parameters": [
                    {
                        "name": "data",
                        "in": "query",
                        "description": "Event data from Stripe webhook containing payment information",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/booking/stripe/webhook": {
            "post": {
                "tags": [
                    "Stripe"
                ],
                "summary": "Stripe webhook receiver",
                "description": "Verifies the `Stripe-Signature` header against `services.stripe.webhook_secret` and dispatches a Laravel Cashier WebhookReceived event with the decoded payload. Stripe-sent webhook; the raw body is read with file_get_contents().",
                "operationId": "bookingStripeWebhook",
                "parameters": [
                    {
                        "name": "Stripe-Signature",
                        "in": "header",
                        "description": "Signature header provided by Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Raw Stripe event JSON. Read from the raw request body, not parsed by Laravel.",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event accepted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid Stripe signature",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid signature"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/subscription-addon": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Create a subscription with add-ons",
                "operationId": "d4de55d961fe053bcb8601c488b96dd6",
                "parameters": [
                    {
                        "name": "package_id",
                        "in": "query",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "plan_id",
                        "in": "query",
                        "description": "ID of the plan",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_item",
                        "in": "query",
                        "description": "Custom items for the subscription (array of item_id => limit)",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Total price of the subscription",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription created successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/selected-subscription": {
            "get": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Get the selected subscription details",
                "operationId": "f974ee68568bfd791a5d5108633e189a",
                "responses": {
                    "200": {
                        "description": "Selected subscription retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/plan-otp-stripe-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Process a payment with OTP verification for a subscription plan",
                "operationId": "482d82ffbf5c700c16c6e959623db8f2",
                "parameters": [
                    {
                        "name": "register_data",
                        "in": "query",
                        "description": "Registration data for the user",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "package_items",
                        "in": "query",
                        "description": "Package items for the subscription",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "plan",
                        "in": "query",
                        "description": "Plan ID for the subscription",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "package",
                        "in": "query",
                        "description": "Package details",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "payment_intent",
                        "in": "query",
                        "description": "Payment intent ID from Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "social",
                        "in": "query",
                        "description": "Whether the registration is via social media",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "type": "string"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "object"
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "object"
                                        },
                                        "choose_module_info": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/subscription-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Process payment for a subscription with add-ons",
                "operationId": "9954539eee9983777e65f4020536c3b9",
                "parameters": [
                    {
                        "name": "register_data",
                        "in": "query",
                        "description": "Registration data for the user",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "package_items",
                        "in": "query",
                        "description": "Package items for the subscription",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "plan",
                        "in": "query",
                        "description": "Plan ID for the subscription",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Payment method ID from Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "package",
                        "in": "query",
                        "description": "Package details",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_costomozed",
                        "in": "query",
                        "description": "Whether the package is customized",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "social",
                        "in": "query",
                        "description": "Whether the registration is via social media",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Coupon code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "xero_info": {
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "type": "string"
                                        },
                                        "columns_grid_of_custom_fields_info": {
                                            "type": "object"
                                        },
                                        "columns_grid_of_leads_info": {
                                            "type": "object"
                                        },
                                        "choose_module_info": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/assign-free-subscription": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Assign a free subscription to a user without requiring payment method",
                "operationId": "71f0c93f255680b3e5b9636254b086df",
                "parameters": [
                    {
                        "name": "package_id",
                        "in": "query",
                        "description": "ID of the package",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "plan_id",
                        "in": "query",
                        "description": "ID of the free plan (Stripe price ID)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user to assign the free subscription to",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "package_items",
                        "in": "query",
                        "description": "Package items for the subscription (array of item details)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Free subscription assigned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Free subscription assigned successfully"
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "subscription_id": {
                                            "type": "string"
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        },
                                        "subscription_status": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/otp-stripe-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Process a payment with OTP verification for an addon",
                "operationId": "b49a7948aeb7cd40b24091433159ae3e",
                "parameters": [
                    {
                        "name": "product",
                        "in": "query",
                        "description": "Product type (simple or year)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit for the addon",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "default_limit",
                        "in": "query",
                        "description": "Default limit for the addon",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "default_rate",
                        "in": "query",
                        "description": "Default rate for the addon",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of the item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Payment method ID from Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item_slug",
                        "in": "query",
                        "description": "Slug of the item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payment_intent",
                        "in": "query",
                        "description": "Payment intent ID from Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        },
                                        "mail": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-subscription/{clientID?}": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Get subscription details for a client",
                "operationId": "64464b9d40f07e2741713830dca0b818",
                "parameters": [
                    {
                        "name": "clientID",
                        "in": "path",
                        "description": "ID of the client to get subscription for (optional, defaults to authenticated user's client)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "active_plan": {
                                            "type": "object"
                                        },
                                        "addonData": {
                                            "type": "object"
                                        },
                                        "free_plan_limits": {
                                            "type": "object"
                                        },
                                        "client": {
                                            "type": "object"
                                        },
                                        "upgrade_count": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/view-addon-details/{id}": {
            "get": {
                "tags": [
                    "Subscription"
                ],
                "summary": "View details of a specific addon",
                "operationId": "da05dd96163e6ddd71b9ff2603d82b7b",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the addon to view",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Addon details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "addonData": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Addon not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/cancel-subscription": {
            "get": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Cancel a subscription",
                "operationId": "0c9adb55917b87e7856bafa1fcc124a9",
                "parameters": [
                    {
                        "name": "subscription_id",
                        "in": "query",
                        "description": "ID of the subscription to cancel",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription cancelled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription cancel successfully."
                                        },
                                        "result": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-subscription-date-in-order": {
            "get": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Update subscription dates in the database",
                "operationId": "e76cf7cc548636a5a7f77e3967d14a4d",
                "responses": {
                    "200": {
                        "description": "Subscription dates updated successfully"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/request-sms-credits": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Request additional SMS credits",
                "operationId": "d8d77ffa87a50af483c4be39f69c6ccd",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Number of SMS credits requested",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "item_title",
                        "in": "query",
                        "description": "Title of the item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item_description",
                        "in": "query",
                        "description": "Description of the item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Price of the SMS credits",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "rate",
                        "in": "query",
                        "description": "Rate of the SMS credits (used if price is not provided)",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Request submitted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your request for SMS Credits has been submitted. We will contact you soon via email."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/stripe-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Process a payment for an addon",
                "operationId": "1cacf0d1e55a493d9afc77b7937dc113",
                "parameters": [
                    {
                        "name": "product",
                        "in": "query",
                        "description": "Product type (simple or year)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Limit for the addon",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "default_limit",
                        "in": "query",
                        "description": "Default limit for the addon",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "default_rate",
                        "in": "query",
                        "description": "Default rate for the addon",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float"
                        }
                    },
                    {
                        "name": "item_id",
                        "in": "query",
                        "description": "ID of the item",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Payment method ID from Stripe",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item_slug",
                        "in": "query",
                        "description": "Slug of the item",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Coupon code (optional)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "stripe_prices_id",
                        "in": "query",
                        "description": "Stripe price ID (required for subscription products)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "data": {
                                            "type": "object"
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        },
                                        "mail": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-subscription-plan": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Get current subscription plan details for the authenticated user",
                "operationId": "4be1f81c78413f5533b0d9099e1be7f4",
                "responses": {
                    "200": {
                        "description": "Subscription plan details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "active": {
                                            "type": "object"
                                        },
                                        "stripe_plan": {
                                            "type": "object"
                                        },
                                        "order": {
                                            "type": "object"
                                        },
                                        "interval": {
                                            "type": "string",
                                            "example": "month"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "User is not subscribed or server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-subscription-plan-details": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Get details for updating a subscription plan",
                "operationId": "202484ac705d19135b26215608929312",
                "parameters": [
                    {
                        "name": "plan",
                        "in": "query",
                        "description": "ID of the plan to get details for",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription plan details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "invoice": {
                                            "type": "object"
                                        },
                                        "proration_date": {
                                            "type": "integer"
                                        },
                                        "current_plan": {
                                            "type": "object"
                                        },
                                        "new_plan": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/upgrade-subscription-plan-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Upgrade a subscription plan with add-ons",
                "operationId": "81c09c032b82440a0ec1cbccfbb68912",
                "parameters": [
                    {
                        "name": "package_items",
                        "in": "query",
                        "description": "Package items for the subscription",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "plan",
                        "in": "query",
                        "description": "ID of the plan to upgrade to",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "package",
                        "in": "query",
                        "description": "Package details",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_costomozed",
                        "in": "query",
                        "description": "Whether the package is customized",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription upgraded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-card": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Update the default payment card and retry any past-due subscription invoices",
                "operationId": "2b7f71c1a2edafa665e77ff360c29162",
                "parameters": [
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Stripe payment method ID to set as default",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Card updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Card updated successfully."
                                        },
                                        "retried_invoices": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "card": {
                                            "type": "object"
                                        },
                                        "user": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Payment method is required"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/subscription-payment-after-login": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Create a subscription and process payment for a user after login",
                "operationId": "0d8797994683e6ba440a77e09c11bf84",
                "parameters": [
                    {
                        "name": "package_items",
                        "in": "query",
                        "description": "Array of package items being purchased",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "plan",
                        "in": "query",
                        "description": "Stripe plan/price ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "description": "Stripe payment method ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "package",
                        "in": "query",
                        "description": "Package details to store in the order history",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Coupon code to apply",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_costomozed",
                        "in": "query",
                        "description": "Flag indicating customized package",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "return_url",
                        "in": "query",
                        "description": "Return URL for SCA confirmation flow",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment was successful or requires confirmation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        },
                                        "subscription_status": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/confirm-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Confirm a successful Stripe payment for a package item purchase",
                "operationId": "660894b00d76bbc9ca7d39648f9c83ae",
                "parameters": [
                    {
                        "name": "package_info",
                        "in": "query",
                        "description": "Package information including item_id, default_rate, limit, item_slug, subscription, code",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "payment_info",
                        "in": "query",
                        "description": "Stripe payment intent info including id, status and amount",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "package_item_buy_type",
                        "in": "query",
                        "description": "1 for one-time purchase, 2 for recurring/subscription",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                1,
                                2
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payment confirmation processed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/checkout-confirm-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Confirm a plan subscription after Stripe checkout completes",
                "operationId": "6de8491a399d65139d971c9d136912a3",
                "parameters": [
                    {
                        "name": "request_data",
                        "in": "query",
                        "description": "Request data including user_id, subscription_id, package_items, package, code, is_costomozed",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "payment_info",
                        "in": "query",
                        "description": "Stripe payment info including amount and status",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Plan subscription confirmed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/upgrade-checkout-confirm-payment": {
            "post": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Confirm a plan upgrade after Stripe checkout completes",
                "operationId": "6615217880411f0a7c8a169a2345e4b5",
                "parameters": [
                    {
                        "name": "request_data",
                        "in": "query",
                        "description": "Request data including subscription_id, plan, package_items, package, is_costomozed",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "payment_info",
                        "in": "query",
                        "description": "Stripe payment info including amount and status",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Plan upgrade confirmed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Your payment is successful."
                                        },
                                        "order_id": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Subscription not found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/resume-subscription": {
            "get": {
                "tags": [
                    "Subscription"
                ],
                "summary": "Resume a cancelled subscription that is still on its grace period",
                "description": "Resumes the authenticated user's cancelled Stripe subscription while it is still on its grace period, and re-enables recurring billing on the matching order.",
                "operationId": "f0d5412322404f45a10b988e42578cb3",
                "parameters": [
                    {
                        "name": "subscription_id",
                        "in": "query",
                        "description": "Stripe subscription ID of the subscription to resume",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "sub_1N4Xy2ABCDEfghij"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Subscription resumed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription resumed successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Subscription not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Subscription not found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error, subscription no longer resumable, or Stripe error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "This subscription can no longer be resumed. Please subscribe again."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/documentation": {
            "get": {
                "tags": [
                    "Swagger"
                ],
                "summary": "Render the interactive Swagger UI for the API",
                "description": "L5-Swagger documentation viewer. Returns the Swagger UI HTML page that consumes the OpenAPI JSON spec.",
                "operationId": "b16660e46fee4b77b127a49f038c4866",
                "responses": {
                    "200": {
                        "description": "Swagger UI HTML page",
                        "content": {
                            "text/html": {}
                        }
                    }
                }
            }
        },
        "/api/oauth2-callback": {
            "get": {
                "tags": [
                    "Swagger"
                ],
                "summary": "OAuth2 redirect handler used by Swagger UI's Try-It-Out flow",
                "description": "L5-Swagger's OAuth2 redirect page that completes the implicit / authorization-code flow initiated from Swagger UI.",
                "operationId": "102845cad1161e8d0a85de328b2eb15f",
                "responses": {
                    "200": {
                        "description": "OAuth2 callback HTML page",
                        "content": {
                            "text/html": {}
                        }
                    }
                }
            }
        },
        "/api/tax": {
            "get": {
                "tags": [
                    "Tax"
                ],
                "summary": "Get list of all taxes",
                "operationId": "1228983966f1a4b074dc84bca8d66e0e",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "taxes": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tax"
                ],
                "summary": "Create a new tax",
                "operationId": "05fe97c019ead040cf983a757ecde3b7",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Tax title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GST"
                        }
                    },
                    {
                        "name": "percentage",
                        "in": "query",
                        "description": "Tax percentage",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float",
                            "example": 10.5
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tax created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Tax Added successfully."
                                        },
                                        "tax": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tax/datatable/get": {
            "post": {
                "tags": [
                    "Tax"
                ],
                "summary": "Get taxes for datatable",
                "operationId": "8bd5afb6f2e26af1fa6ec57613884ee5",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tax/{id}": {
            "get": {
                "tags": [
                    "Tax"
                ],
                "summary": "Get specific tax by ID",
                "operationId": "b654b3a7a42c67b0cd34af0262b9dc30",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Tax ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "tax": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Tax not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "No Tax Found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Tax"
                ],
                "summary": "Update specific tax by ID",
                "operationId": "1162cdaa9c3ae188306096c068a83cb9",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Tax ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Tax title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "GST"
                        }
                    },
                    {
                        "name": "percentage",
                        "in": "query",
                        "description": "Tax percentage",
                        "required": true,
                        "schema": {
                            "type": "number",
                            "format": "float",
                            "example": 10.5
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tax updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Tax Updated Successfully."
                                        },
                                        "tax": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Tax not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Tax Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Tax"
                ],
                "summary": "Delete specific tax by ID",
                "operationId": "e353dff54364a99584b806129cea34e8",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Tax ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tax deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Tax Deleted Successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Tax not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "example": "Tax Not Found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team": {
            "get": {
                "tags": [
                    "Team"
                ],
                "summary": "Get list of teams",
                "operationId": "e27dfadb09d14fea8aa10b8c0dca772e",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "teams": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Team"
                ],
                "summary": "Create a new team",
                "operationId": "af05b6e6d1a81092b28a5a403ca2d1ea",
                "parameters": [
                    {
                        "name": "team_name",
                        "in": "query",
                        "description": "Name of the team",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team Added Successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-user-list-datatable": {
            "post": {
                "tags": [
                    "Team"
                ],
                "summary": "Get team user list for datatable",
                "operationId": "13a195e11fadf3528a64dc8a0253b022",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-team-member": {
            "post": {
                "tags": [
                    "Team"
                ],
                "summary": "Add members to a team",
                "operationId": "4f30638967410a4a379b50f0a38b0c4e",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "query",
                        "description": "ID of the team",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "description": "Array of user IDs to add to the team",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team members added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team Member Added Successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/remove-team-member": {
            "post": {
                "tags": [
                    "Team"
                ],
                "summary": "Remove members from a team",
                "operationId": "6df20bb2cd8f3de96099fd8a071b4dbe",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "query",
                        "description": "ID of the team",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "description": "Array of user IDs to remove from the team",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team members removed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team Member Removed Successfully..!"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-users": {
            "get": {
                "tags": [
                    "Team"
                ],
                "summary": "Get list of active team users",
                "operationId": "94f6a7945a65673a4257a4b8aeac3870",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "teams": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "team_id": {
                                                        "type": "integer"
                                                    },
                                                    "team_name": {
                                                        "type": "string"
                                                    },
                                                    "team_member": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team/{team}": {
            "get": {
                "tags": [
                    "Team"
                ],
                "summary": "Display the specified team",
                "operationId": "0087180eba93ca046d27627dc7ac8196",
                "parameters": [
                    {
                        "name": "team",
                        "in": "path",
                        "description": "ID of the team",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team retrieved successfully"
                    },
                    "404": {
                        "description": "Team not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Team"
                ],
                "summary": "Update the specified team",
                "operationId": "0f25e4c12d7eeba0f735a17dca7d27e3",
                "parameters": [
                    {
                        "name": "team",
                        "in": "path",
                        "description": "ID of the team to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team updated successfully"
                    },
                    "404": {
                        "description": "Team not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Team"
                ],
                "summary": "Delete the specified team",
                "operationId": "5a7235b2a4f616c4eb00a9cc3e7c8867",
                "parameters": [
                    {
                        "name": "team",
                        "in": "path",
                        "description": "ID of the team to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team deleted successfully"
                    },
                    "404": {
                        "description": "Team not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get all team members for the authenticated user's client",
                "operationId": "413e892fcb8b4dc5d5b327b49ac3b098",
                "responses": {
                    "200": {
                        "description": "List of team members retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Create a new team member",
                "operationId": "9c88387c305c3c772994f37fb73bf721",
                "parameters": [
                    {
                        "name": "name_title",
                        "in": "query",
                        "description": "Title (Mr., Mrs., etc.)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password"
                        }
                    },
                    {
                        "name": "job_title",
                        "in": "query",
                        "description": "Job title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "Role",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date_of_hire",
                        "in": "query",
                        "description": "Date of hire (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "salary",
                        "in": "query",
                        "description": "Salary",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "salary_term",
                        "in": "query",
                        "description": "Salary term (hourly, monthly, etc.)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "other_info": {
                                            "type": "object"
                                        },
                                        "accessToken": {
                                            "type": "string"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team member created and email is sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member/datatable/get": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get team members data formatted for datatables",
                "operationId": "fd7487218a860c25b8c4d884408492cd",
                "responses": {
                    "200": {
                        "description": "Team members data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/client-all-member": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get all users across all clients formatted for datatables",
                "operationId": "eef4af59a834c5cc2bda5d0261c9003c",
                "responses": {
                    "200": {
                        "description": "All users data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer"
                                        },
                                        "recordsTotal": {
                                            "type": "integer"
                                        },
                                        "recordsFiltered": {
                                            "type": "integer"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member-add": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Create a new team member with different validation requirements",
                "operationId": "2d6a4435fdbdd938442db0d21305b402",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "Role",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "emergency_contact",
                        "in": "query",
                        "description": "Emergency contact",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "address",
                        "in": "query",
                        "description": "Address",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "City",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "State",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "other_info": {
                                            "type": "object"
                                        },
                                        "accessToken": {
                                            "type": "string"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team member created and email is sent successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member-calendar-settings-save": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Save calendar settings for a team member",
                "operationId": "3b85d2958f135a457d0e58edad6717c5",
                "parameters": [
                    {
                        "name": "calendar_type",
                        "in": "query",
                        "description": "Calendar type",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "calendar_username",
                        "in": "query",
                        "description": "Calendar username",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "calendar_password",
                        "in": "query",
                        "description": "Calendar password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password"
                        }
                    },
                    {
                        "name": "cal_user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Calendar settings saved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member/{id}": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get details for a specific team member",
                "operationId": "54a33f92b8065333846d4c5581c7248e",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Team member ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "users_info": {
                                            "type": "object"
                                        },
                                        "profile_path": {
                                            "type": "string"
                                        },
                                        "role": {
                                            "type": "string"
                                        },
                                        "role_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Team member not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member-update/{id}": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a team member's information",
                "operationId": "4d2c4c49cc009ec0655da9466f250a48",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Team member ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 55
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email address",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "date_of_hire",
                        "in": "query",
                        "description": "Date of hire (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "dob",
                        "in": "query",
                        "description": "Date of birth",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "name_title",
                        "in": "query",
                        "description": "Title (Mr., Mrs., etc.)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "Gender",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "job_title",
                        "in": "query",
                        "description": "Job title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "timezone",
                        "in": "query",
                        "description": "Timezone",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "nickname",
                        "in": "query",
                        "description": "Nickname",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ni_number",
                        "in": "query",
                        "description": "NI number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "nationality",
                        "in": "query",
                        "description": "Nationality",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "emergency_contact",
                        "in": "query",
                        "description": "Emergency contact",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "user": {
                                            "type": "object"
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Team member updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "404": {
                        "description": "Team member not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-today-birthday": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get team members with birthdays today",
                "operationId": "f0ee36086bebd1e33911966571817793",
                "responses": {
                    "200": {
                        "description": "Today's birthdays retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-today-work-anniversary": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get team members with work anniversaries today",
                "operationId": "4f58e684f9739bbbf41263ae373b0765",
                "responses": {
                    "200": {
                        "description": "Today's work anniversaries retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member/download-attachment": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Download a team member's attachment",
                "operationId": "792dcdc2e5df80c2d606f1814b4b8665",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "User info ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Attachment index",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File downloaded successfully"
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member/delete-attachment": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Delete a team member's attachment",
                "operationId": "dfc54cdd11548131a934776000c38f3a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "User info ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "attachment_index",
                        "in": "query",
                        "description": "Attachment index",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "File not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-password": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's password",
                "operationId": "dfc86b7c21448c4cbeb08c7781b44876",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "New password",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "password"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Password updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Password updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-name": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's name",
                "operationId": "373ba4388e868d3e73f0dff16d341559",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "first_name",
                        "in": "query",
                        "description": "First name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "description": "Last name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Name updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Name updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-primary-phone": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's primary phone number",
                "operationId": "a5226bba76d1030b44c8e1089a6e8f82",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Phone number updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-emergency-phone": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's emergency contact phone number",
                "operationId": "593ba74edd5d6814860acf3e7c099334",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "emergency_contact",
                        "in": "query",
                        "description": "Emergency contact phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Emergency contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-primary-contact": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's primary contact number",
                "operationId": "b79ea4f42072cc43dde905d465e8ea8e",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "primary_contact_number",
                        "in": "query",
                        "description": "Primary contact number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Primary contact updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-address": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's address",
                "operationId": "61f4afdfe4545f6d24716508bb6e88fc",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "address",
                        "in": "query",
                        "description": "User's address",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Address updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-status": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's status (active/inactive)",
                "operationId": "a729d4681f39f90adb2b7e1e170e0e8c",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_status",
                        "in": "query",
                        "description": "User status (0 for inactive, 1 for active)",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user_id": {
                                            "type": "integer"
                                        },
                                        "user_status": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-user": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Delete a user if they have no assigned leads",
                "operationId": "18a8d85c39bf469ae1d9d7d11af51e80",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User deleted successfully or deletion prevented due to assigned leads",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/change-user-role": {
            "post": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update a user's role",
                "operationId": "187d2a180742e87d91ebdadf2f39360a",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "Role name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Role updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Role updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/zapier-custom-fields-propagation-for-assigned-to": {
            "get": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Get team members of a client by user email for Zapier 'assigned to' propagation",
                "operationId": "e9f3f719f084b1956c08567f6d4d11af",
                "parameters": [
                    {
                        "name": "userName",
                        "in": "query",
                        "description": "Email of the user used to identify the client",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of team members retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/team-member/{team_member}": {
            "put": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Update the specified team member",
                "operationId": "6eb5de021878d0c4c53e732a2e596661",
                "parameters": [
                    {
                        "name": "team_member",
                        "in": "path",
                        "description": "ID of the team member to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Team member updated successfully"
                    },
                    "404": {
                        "description": "Team member not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Team Members"
                ],
                "summary": "Delete the specified team member and reassign their work",
                "operationId": "0f4476a5b49722441fc19284335b5482",
                "parameters": [
                    {
                        "name": "team_member",
                        "in": "path",
                        "description": "ID of the team member to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "ID of the user to whom the deleted member's leads, tasks, campaigns and project memberships will be reassigned",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "User Deleted Successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/telsaleads/webhook": {
            "post": {
                "tags": [
                    "TelsaLeads Webhook"
                ],
                "summary": "TelsaLeads webhook receiver",
                "description": "Receives TelsaLeads visitor-tracking events (specific_page_visited, abandoned_cart). Looks up an existing Lead by telsa_visitor_id, falling back to email; creates a new Lead + LeadContact if neither matches and a client_id is resolvable. Then dispatches a TriggerAutomationJob for the event.",
                "operationId": "telsaLeadsHandleWebhook",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event",
                                    "visitor_id"
                                ],
                                "properties": {
                                    "event": {
                                        "description": "Event type",
                                        "type": "string",
                                        "example": "specific_page_visited",
                                        "enum": [
                                            "specific_page_visited",
                                            "abandoned_cart"
                                        ]
                                    },
                                    "visitor_id": {
                                        "description": "TelsaLeads visitor identifier",
                                        "type": "string",
                                        "example": "vst_abc123"
                                    },
                                    "client_id": {
                                        "description": "Optional explicit client scope",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "site_id": {
                                        "description": "Fallback to resolve client_id via CallTracking.current_site",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "email": {
                                        "description": "Used as a secondary key when telsa_visitor_id doesn't match",
                                        "type": "string",
                                        "format": "email",
                                        "nullable": true
                                    },
                                    "first_name": {
                                        "description": "Used when creating a new lead contact (default 'Website')",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "last_name": {
                                        "description": "Used when creating a new lead contact (default 'Visitor')",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "phone": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "data": {
                                        "description": "Event-specific payload",
                                        "properties": {
                                            "page_url": {
                                                "description": "Used by specific_page_visited to match automation rules",
                                                "type": "string",
                                                "nullable": true
                                            }
                                        },
                                        "type": "object",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook processed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Webhook processed successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No matching lead and client_id could not be resolved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Lead not found and client_id missing"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error (missing event or visitor_id)"
                    }
                }
            }
        },
        "/api/ticket": {
            "get": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Get all tickets",
                "operationId": "91f89830cd8e2ef054124d4f2f0b167d",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "tickets": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Create a new ticket",
                "operationId": "57a42931900b7ea26b87dc822429b792",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Ticket title",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Ticket description",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ticket_type_id",
                        "in": "query",
                        "description": "Ticket type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the ticket to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Ticket status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "in progress",
                                "closed"
                            ]
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Ticket priority",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "low",
                                "medium",
                                "high"
                            ]
                        }
                    },
                    {
                        "name": "attachment",
                        "in": "query",
                        "description": "Ticket attachment",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket created successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error creating ticket"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket/datatable/get": {
            "post": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Get tickets for datatable",
                "operationId": "69aa36e4765266f3ee2c621efcc7e139",
                "parameters": [
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "Filter by assigned user IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "ticket_type_id",
                        "in": "query",
                        "description": "Filter by ticket type IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Filter by client IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Filter by status",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket/{id}": {
            "get": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Get ticket details",
                "operationId": "c18723a4903333fcbf81e288f6dba93c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "ticket": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Update a ticket",
                "operationId": "a04b47df28f5a1d94621a0681514ca5c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Ticket title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Ticket description",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ticket_type_id",
                        "in": "query",
                        "description": "Ticket type ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "assigned_to",
                        "in": "query",
                        "description": "User ID to assign the ticket to",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Ticket status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "in progress",
                                "closed"
                            ]
                        }
                    },
                    {
                        "name": "priority",
                        "in": "query",
                        "description": "Ticket priority",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "low",
                                "medium",
                                "high"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Delete a ticket",
                "operationId": "4c5b0354ff93312725e6b8a9999ea236",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket deleted successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-comment": {
            "post": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Add a new comment to a ticket",
                "operationId": "176bcd001986c68c8524c80d8f38e9ea",
                "parameters": [
                    {
                        "name": "ticket_id",
                        "in": "query",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "comment",
                        "in": "query",
                        "description": "Comment text",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attachment",
                        "in": "query",
                        "description": "Comment attachment",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Comment added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Comment added successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error adding comment"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-comment/{id}": {
            "get": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Get comments for a ticket",
                "operationId": "9665297a1118a9c5d745fa66c5ad8dfb",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "comments": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-comment/download-attachment": {
            "get": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Download ticket comment attachment",
                "operationId": "04555f13483c852122e8e575c93add69",
                "parameters": [
                    {
                        "name": "file_name",
                        "in": "query",
                        "description": "File name to download",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File downloaded successfully"
                    },
                    "404": {
                        "description": "File not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/s3-image-upload": {
            "post": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Upload an image for a ticket",
                "operationId": "cd8812e34a94783f49d83bbd9f7389ab",
                "parameters": [
                    {
                        "name": "image",
                        "in": "query",
                        "description": "Image file to upload",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Image uploaded successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "image_name": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error uploading image"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tickets-update-status": {
            "post": {
                "tags": [
                    "Tickets"
                ],
                "summary": "Update ticket status",
                "operationId": "b74c198562a88b7eca91ff95385c881c",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Ticket ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "New status for the ticket",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "open",
                                "in progress",
                                "closed"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Status updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Status updated successfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-type": {
            "get": {
                "tags": [
                    "Ticket Types"
                ],
                "summary": "Get all ticket types",
                "operationId": "f2ba2cb76aed75477b9ca949496e29b6",
                "responses": {
                    "200": {
                        "description": "List of all ticket types",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "types": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No data found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Ticket Types"
                ],
                "summary": "Create a new ticket type",
                "operationId": "636b809d1ef584275b3819a6c2391f98",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Title of the ticket type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Support"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket type created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket type added successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-type/{id}": {
            "put": {
                "tags": [
                    "Ticket Types"
                ],
                "summary": "Update an existing ticket type",
                "operationId": "8d4258629b6ceba5d358dd687e53e4cd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the ticket type to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "New title for the ticket type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Technical Support"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket type updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket type update successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket type not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Ticket Types"
                ],
                "summary": "Delete a ticket type",
                "operationId": "96ef3cf56505c0aeeb2a49fcf0898cc1",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the ticket type to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Ticket type deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Ticket type deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Ticket type not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ticket-type/{ticket_type}": {
            "get": {
                "tags": [
                    "Ticket Type"
                ],
                "summary": "Show a single ticket type (resource show – placeholder, not currently implemented)",
                "operationId": "f0d7322fc0894ebd740edeef693908fa",
                "parameters": [
                    {
                        "name": "ticket_type",
                        "in": "path",
                        "description": "Ticket type ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tiktok-authorization": {
            "get": {
                "tags": [
                    "Tiktok"
                ],
                "summary": "Connect to TikTok and return user info plus video list, or return an auth link",
                "operationId": "8a8512073dfefec1d6f3fdd6c743744c",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Pagination cursor for the TikTok video list",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TikTok connection details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "token": {
                                            "type": "string"
                                        },
                                        "user_info": {
                                            "type": "object"
                                        },
                                        "video_list": {
                                            "type": "object"
                                        },
                                        "auth_link": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tiktok/callback": {
            "get": {
                "tags": [
                    "Tiktok"
                ],
                "summary": "Handle TikTok OAuth callback and persist access tokens",
                "operationId": "d6169ca80413db29dd74f90dc595d26a",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by TikTok",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "error",
                        "in": "query",
                        "description": "Error code returned by TikTok when authorization fails",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "error_description",
                        "in": "query",
                        "description": "Human-readable error description from TikTok",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "TikTok logged in successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "TikTok logged in"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Something went wrong"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tiktok/upload": {
            "post": {
                "tags": [
                    "Tiktok"
                ],
                "summary": "Upload a video to S3 and queue an inbox upload job to TikTok",
                "operationId": "e6723bd5f98b5e6ffef5ee8f8b6962a2",
                "parameters": [
                    {
                        "name": "video",
                        "in": "query",
                        "description": "MP4 video file (max 500MB)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Optional video description (max 200 chars)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Video uploaded to S3 and TikTok upload queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Video uploaded to S3. TikTok upload queued."
                                        },
                                        "upload_id": {
                                            "type": "integer"
                                        },
                                        "s3_path": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/tiktok/direct-post": {
            "post": {
                "tags": [
                    "Tiktok"
                ],
                "summary": "Upload a video to S3 and queue a direct publish job to TikTok",
                "operationId": "703f2db228d510d4be6c60a06758c34f",
                "parameters": [
                    {
                        "name": "video",
                        "in": "query",
                        "description": "MP4 video file (max 500MB)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    },
                    {
                        "name": "description",
                        "in": "query",
                        "description": "Optional video description (max 200 chars)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Video uploaded to S3 and TikTok publish queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Video uploaded to S3. TikTok upload queued."
                                        },
                                        "upload_id": {
                                            "type": "integer"
                                        },
                                        "s3_path": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/turnover-options": {
            "get": {
                "tags": [
                    "Turnover Settings"
                ],
                "summary": "Get turnover field settings for the authenticated user's client",
                "operationId": "abd9035fc12d8f82806bbf3420c0fc52",
                "responses": {
                    "200": {
                        "description": "Turnover settings retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "settings": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "lead_positions": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Turnover Settings"
                ],
                "summary": "Save turnover field settings for the authenticated user's client",
                "operationId": "4f135d1b1ae1458304a63d2b61c107c4",
                "parameters": [
                    {
                        "name": "settings",
                        "in": "query",
                        "description": "Array of turnover settings to save",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "0-10k"
                                    },
                                    "visibility_position_wise": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "sort": {
                                        "type": "integer",
                                        "example": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings saved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings saved successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/turnover-options/{id}": {
            "put": {
                "tags": [
                    "Turnover Settings"
                ],
                "summary": "Update a specific turnover field setting",
                "operationId": "d91a02846a363ad1277208ac6dc0de5a",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the turnover setting to update",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the turnover setting",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "10k-50k"
                        }
                    },
                    {
                        "name": "visibility_position_wise",
                        "in": "query",
                        "description": "JSON array of position-wise visibility settings",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort order of the setting",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 2
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/login": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Generate X (Twitter) OAuth login URL",
                "operationId": "270ecfc9664aae37f147223dee88f6a5",
                "responses": {
                    "200": {
                        "description": "Login URL generated successfully"
                    },
                    "500": {
                        "description": "Failed to generate login URL"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/callback": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Handle X (Twitter) OAuth callback and connect account",
                "operationId": "7ae67f2c0f212f54baf8cf06203612b0",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by X",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "OAuth state parameter returned by X",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code_verifier",
                        "in": "query",
                        "description": "PKCE code verifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "original_state",
                        "in": "query",
                        "description": "Original state to validate the callback",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Twitter account connected successfully"
                    },
                    "404": {
                        "description": "Invalid user ID provided"
                    },
                    "500": {
                        "description": "Twitter connection failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/status": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get current CRM user's Twitter connection status",
                "operationId": "49708e9d93dc37ea3b3619989661ca56",
                "responses": {
                    "200": {
                        "description": "Connection status retrieved successfully"
                    },
                    "500": {
                        "description": "Twitter status error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/user/me": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get authenticated Twitter user's profile",
                "operationId": "f82c61d27b47a8675ecbcf8ccee2c30f",
                "responses": {
                    "200": {
                        "description": "User profile retrieved successfully"
                    },
                    "500": {
                        "description": "Failed to retrieve user profile"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/disconnect": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Disconnect Twitter account from CRM user",
                "operationId": "d1b4bd9352e93a85b1bcf378ce77a320",
                "responses": {
                    "200": {
                        "description": "Twitter account disconnected successfully"
                    },
                    "500": {
                        "description": "Failed to disconnect Twitter account"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/post": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Create a new tweet (immediate or scheduled)",
                "operationId": "5c28bc1ef141d8ff0bbcd4db217870eb",
                "parameters": [
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Tweet text (max 280 characters)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 280
                        }
                    },
                    {
                        "name": "images",
                        "in": "query",
                        "description": "Up to 4 media files (jpg, jpeg, png, webp, bmp, tif, tiff, gif, mp4)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            },
                            "maxItems": 4
                        }
                    },
                    {
                        "name": "scheduled_at",
                        "in": "query",
                        "description": "Optional schedule time (must be in the future and within 160 days)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "in_reply_to_tweet_id",
                        "in": "query",
                        "description": "Optional tweet ID this post is replying to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tweet posted or scheduled successfully"
                    },
                    "500": {
                        "description": "Failed to post or schedule tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/share": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Share (retweet) a tweet",
                "operationId": "66b4a4db4c70e3388d2748329a712906",
                "parameters": [
                    {
                        "name": "tweet_id",
                        "in": "query",
                        "description": "ID of the tweet to share",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tweet shared successfully"
                    },
                    "500": {
                        "description": "Failed to share tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/delete": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Delete a tweet",
                "operationId": "549eb8c536107df749c35109fb6668ad",
                "parameters": [
                    {
                        "name": "tweet_id",
                        "in": "query",
                        "description": "ID of the tweet to delete",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tweet deleted successfully"
                    },
                    "500": {
                        "description": "Failed to delete tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/like": {
            "post": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Like or unlike a tweet",
                "operationId": "a96a2d6df264d2d8272a8f047f413946",
                "parameters": [
                    {
                        "name": "tweet_id",
                        "in": "query",
                        "description": "ID of the tweet to like or unlike",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tweet liked or unliked successfully"
                    },
                    "500": {
                        "description": "Failed to like/unlike tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/timeline": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get authenticated user's Twitter timeline",
                "operationId": "72754ac1b95adfdb705faa3f530f5ed7",
                "parameters": [
                    {
                        "name": "max_results",
                        "in": "query",
                        "description": "Maximum number of tweets to return (1-100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "maximum": 100,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "pagination_token",
                        "in": "query",
                        "description": "Pagination token for fetching the next page",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Timeline retrieved successfully"
                    },
                    "500": {
                        "description": "Failed to retrieve timeline"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/tweet/{id}": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get a single tweet with full details and optional replies",
                "operationId": "60b42434ee9118fcc3033b8010a347a4",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the tweet to retrieve",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_replies",
                        "in": "query",
                        "description": "Whether to fetch replies (true/false/1/0)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false",
                                "1",
                                "0"
                            ]
                        }
                    },
                    {
                        "name": "max_replies",
                        "in": "query",
                        "description": "Maximum number of replies to fetch (10-100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "maximum": 100,
                            "minimum": 10
                        }
                    },
                    {
                        "name": "pagination_token",
                        "in": "query",
                        "description": "Pagination token for fetching the next page of replies",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tweet retrieved successfully"
                    },
                    "500": {
                        "description": "Failed to retrieve tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/scheduled": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get all scheduled tweets for the authenticated user",
                "operationId": "972d3e2ca28cfa796dd45cc8a33a3ea9",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Optional filter by scheduled tweet status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled tweets retrieved successfully"
                    },
                    "500": {
                        "description": "Failed to retrieve scheduled tweets"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/twitter/scheduled/{scheduledTweetId}": {
            "get": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Get a single scheduled tweet's details",
                "operationId": "3d837d996ad6ce65f936b1266d2531bf",
                "parameters": [
                    {
                        "name": "scheduledTweetId",
                        "in": "path",
                        "description": "ID of the scheduled tweet",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled tweet retrieved successfully"
                    },
                    "404": {
                        "description": "Scheduled tweet not found"
                    },
                    "500": {
                        "description": "Failed to retrieve scheduled tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Cancel a scheduled tweet",
                "operationId": "769626af22b23f13a5fe66bd328debb4",
                "parameters": [
                    {
                        "name": "scheduledTweetId",
                        "in": "path",
                        "description": "ID of the scheduled tweet to cancel",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled tweet cancelled successfully"
                    },
                    "404": {
                        "description": "Scheduled tweet not found"
                    },
                    "500": {
                        "description": "Failed to cancel scheduled tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Twitter"
                ],
                "summary": "Update a scheduled tweet (only if still pending)",
                "operationId": "4cfa44e67504537bf0a9f0d27f9083c3",
                "parameters": [
                    {
                        "name": "scheduledTweetId",
                        "in": "path",
                        "description": "ID of the scheduled tweet to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "text",
                        "in": "query",
                        "description": "Updated tweet text (max 280 characters)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 280
                        }
                    },
                    {
                        "name": "images",
                        "in": "query",
                        "description": "Up to 4 media files (jpg, jpeg, png, webp, bmp, tif, tiff, gif, mp4)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "binary"
                            },
                            "maxItems": 4
                        }
                    },
                    {
                        "name": "scheduled_at",
                        "in": "query",
                        "description": "Updated schedule time (must be in the future and within 160 days)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "in_reply_to_tweet_id",
                        "in": "query",
                        "description": "Optional tweet ID this post is replying to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scheduled tweet updated successfully"
                    },
                    "404": {
                        "description": "Scheduled tweet not found"
                    },
                    "500": {
                        "description": "Failed to update scheduled tweet"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-user-signature": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Get user signature",
                "operationId": "5942936e6e261370849001fc2f0df509",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User signature retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "signature_type": {
                                                    "type": "string",
                                                    "example": "default"
                                                },
                                                "custom_signature": {
                                                    "type": "string",
                                                    "example": "<p>John Doe<br>CEO</p>"
                                                },
                                                "signature": {
                                                    "type": "string",
                                                    "example": "<p>John Doe<br>CEO</p>"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No signature found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No Signature found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-user-signature-details": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Get user signature details",
                "operationId": "3de60c3d214935a70fe5af448083f2c1",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User signature details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "properties": {
                                                "signature_type": {
                                                    "type": "string",
                                                    "example": "default"
                                                },
                                                "custom_signature": {
                                                    "type": "string",
                                                    "example": "<p>John Doe<br>CEO</p>"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "No signature found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No Signature found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-signature": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Update user signature",
                "operationId": "f32953718c046cd7fbc1f97bfb609365",
                "parameters": [
                    {
                        "name": "custom_signature",
                        "in": "query",
                        "description": "Custom signature HTML content",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "<p>John Doe<br>CEO</p>"
                        }
                    },
                    {
                        "name": "signature_type",
                        "in": "query",
                        "description": "Type of signature",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "default"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Signature updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "string",
                                            "example": "Signature Updated"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/update-device-token": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Update user device token",
                "operationId": "15edf82ff7cb7e69712a81cd19f5983c",
                "parameters": [
                    {
                        "name": "device_key",
                        "in": "query",
                        "description": "Device token/key for push notifications",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "fcm_token_123456789"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "ID of the user",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Device key updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "string",
                                            "example": "User device Key has been updated sucessfully"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error updating device key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-feedback-user-info": {
            "post": {
                "tags": [
                    "User Feedback"
                ],
                "summary": "Get user information from feedback hash",
                "operationId": "8b700f6129c65a93142c1869b8910d6d",
                "parameters": [
                    {
                        "name": "user_hash",
                        "in": "query",
                        "description": "Hash identifying the user feedback",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "a1b2c3d4e5f6g7h8i9j0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "feedback not submitted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "User not found or error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/post-feedback": {
            "post": {
                "tags": [
                    "User Feedback"
                ],
                "summary": "Submit user feedback",
                "operationId": "7b6bb7f877463e8b785e86dd4dd92615",
                "parameters": [
                    {
                        "name": "user_hash",
                        "in": "query",
                        "description": "Hash identifying the user feedback",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "a1b2c3d4e5f6g7h8i9j0"
                        }
                    },
                    {
                        "name": "subject",
                        "in": "query",
                        "description": "Subject of the feedback",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Product Feedback"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Content of the feedback",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "I really like the new features, but I think..."
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback submitted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Feedback Posted."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error submitting feedback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Error posting feedback"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-all-user-feedbacks": {
            "post": {
                "tags": [
                    "User Feedback"
                ],
                "summary": "Get all user feedbacks",
                "operationId": "fb85255c894f030ae44fc41378b19a4d",
                "responses": {
                    "200": {
                        "description": "List of all user feedbacks",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "draw": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "recordsTotal": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "recordsFiltered": {
                                            "type": "integer",
                                            "example": 10
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "client_id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "user_id": {
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "feedback_submitted": {
                                                        "type": "boolean",
                                                        "example": true
                                                    },
                                                    "user_hash": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4e5f6g7h8i9j0"
                                                    },
                                                    "subject": {
                                                        "type": "string",
                                                        "example": "Product Feedback"
                                                    },
                                                    "notes": {
                                                        "type": "string",
                                                        "example": "I really like the new features"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01 12:00:00"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time",
                                                        "example": "2023-01-01 12:30:00"
                                                    },
                                                    "users_table_id": {
                                                        "type": "integer",
                                                        "example": 5
                                                    },
                                                    "first_name": {
                                                        "type": "string",
                                                        "example": "John"
                                                    },
                                                    "last_name": {
                                                        "type": "string",
                                                        "example": "Doe"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "example": "john.doe@example.com"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/feedback/{id}": {
            "get": {
                "tags": [
                    "User Feedback"
                ],
                "summary": "Get a single feedback by ID",
                "operationId": "d8319eca0bafba998b18f2282c4de86f",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the feedback to retrieve",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Feedback details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "all_data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "client_id": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "user_id": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "feedback_submitted": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "user_hash": {
                                                    "type": "string",
                                                    "example": "a1b2c3d4e5f6g7h8i9j0"
                                                },
                                                "subject": {
                                                    "type": "string",
                                                    "example": "Product Feedback"
                                                },
                                                "notes": {
                                                    "type": "string",
                                                    "example": "I really like the new features"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01 12:00:00"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "example": "2023-01-01 12:30:00"
                                                },
                                                "applicant_name": {
                                                    "type": "string",
                                                    "example": "John Doe"
                                                },
                                                "job_title": {
                                                    "type": "string",
                                                    "example": "Software Developer"
                                                },
                                                "profile_img": {
                                                    "type": "string",
                                                    "example": "https://example.com/profile.jpg"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Feedback not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Feedback not found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-wa-client": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Check WhatsApp business account information",
                "operationId": "8380945a87165a1e0a97b1d0ae8b6e50",
                "responses": {
                    "200": {
                        "description": "Business account information retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Business Account Found"
                                        },
                                        "waba_id": {
                                            "type": "integer",
                                            "example": 123
                                        },
                                        "business_phone_number": {
                                            "type": "string",
                                            "example": "+447911123456"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error retrieving business information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-wa-client": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Delete WhatsApp business account information",
                "operationId": "2a2807bc743be67439410f5c73ef71b2",
                "responses": {
                    "200": {
                        "description": "Business account deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Business Account Deleted"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error deleting business information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/store-wa-client-information": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Store WhatsApp business account information",
                "operationId": "c54e55f5e1ae672672964857cae50cd0",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Facebook",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "AQD..."
                        }
                    },
                    {
                        "name": "phone_number_id",
                        "in": "query",
                        "description": "WhatsApp phone number ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "123456789"
                        }
                    },
                    {
                        "name": "waba_id",
                        "in": "query",
                        "description": "WhatsApp Business Account ID",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "987654321"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Business account information stored successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "subscription_status": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Whatsapp Business Account Linked."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error storing business information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Error message"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/create-ai-agent": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Create an AI agent user for the authenticated user's client",
                "description": "Provisions a new internal user record flagged as an AI agent (is_ai_agent=1) under the current client, using a generated email and password.",
                "operationId": "aede903ba871345434071473763a6796",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "manager_name"
                                ],
                                "properties": {
                                    "manager_name": {
                                        "description": "Display name for the AI agent; first token becomes first_name, remainder last_name",
                                        "type": "string",
                                        "example": "Sales Bot",
                                        "maxLength": 255
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "AI agent created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "first_name": {
                                                    "type": "string"
                                                },
                                                "last_name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/ai-agents": {
            "get": {
                "tags": [
                    "User"
                ],
                "summary": "List AI agent users for the authenticated user's client",
                "operationId": "c90bc7c7ca786d9ad834c4edb375dff6",
                "responses": {
                    "200": {
                        "description": "AI agents returned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "first_name": {
                                                        "type": "string"
                                                    },
                                                    "last_name": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "No AI agents found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "No AI agents found."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user/media-datatable": {
            "post": {
                "tags": [
                    "User Media"
                ],
                "summary": "Get user media as a DataTables response",
                "operationId": "0a83a1b774207231be5488b93fc3d7bb",
                "responses": {
                    "200": {
                        "description": "User media datatable retrieved successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user-media": {
            "get": {
                "tags": [
                    "User Media"
                ],
                "summary": "Get list of media files for the authenticated user",
                "operationId": "8e59a786dd87c586103342b956d58f76",
                "responses": {
                    "200": {
                        "description": "User media retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user_files": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User media not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "User Media"
                ],
                "summary": "Upload a new user media file",
                "operationId": "9fd5c7139e9716ace597186757d86137",
                "parameters": [
                    {
                        "name": "fileName",
                        "in": "query",
                        "description": "Display name for the uploaded file",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "description": "File to upload",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "binary"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File stored successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File stored successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error or storage limit exceeded"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/user-media/{user_medium}": {
            "get": {
                "tags": [
                    "User Media"
                ],
                "summary": "Display the specified user media file",
                "operationId": "ba16ced4f778e55ec6730e0d39013a2e",
                "parameters": [
                    {
                        "name": "user_medium",
                        "in": "path",
                        "description": "ID of the user media record",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User media retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "user_file": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User media not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "User Media"
                ],
                "summary": "Update the specified user media file name",
                "operationId": "a0392c10ab973cbaa0f0bcb5c78dd049",
                "parameters": [
                    {
                        "name": "user_medium",
                        "in": "path",
                        "description": "ID of the user media record to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "fileName",
                        "in": "query",
                        "description": "Updated display name for the file",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User media not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "User Media"
                ],
                "summary": "Delete the specified user media file",
                "operationId": "4b5cd4ca89f995b6d0988b03d50aeb48",
                "parameters": [
                    {
                        "name": "user_medium",
                        "in": "path",
                        "description": "ID of the user media record to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "File deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "File deleted successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "User media not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/notification-settings": {
            "get": {
                "tags": [
                    "User Notification Setting"
                ],
                "summary": "List notification events available to the user, grouped by category, with current enabled state",
                "description": "Returns the configured notification_events from config, filtered to those visible to the user's client, sorted by category and event sort_order, with the user's current preference applied.",
                "operationId": "55c78e9c39509070647513b592722d51",
                "responses": {
                    "200": {
                        "description": "Grouped notification events with the user's preferences",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "User Notification Setting"
                ],
                "summary": "Bulk update the authenticated user's notification preferences",
                "operationId": "9ef4bfc68c655c0e6c27b0bbef8bab86",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "settings"
                                ],
                                "properties": {
                                    "settings": {
                                        "description": "List of {event, enabled} pairs to upsert",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "event",
                                                "enabled"
                                            ],
                                            "properties": {
                                                "event": {
                                                    "description": "Notification event key",
                                                    "type": "string",
                                                    "example": "lead.created"
                                                },
                                                "enabled": {
                                                    "description": "Whether the user wants to receive this event",
                                                    "type": "boolean"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settings updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Notification settings updated successfully."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "500": {
                        "description": "Something went wrong while saving notification settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Something went wrong while saving notification settings."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/visitors/{id}": {
            "post": {
                "tags": [
                    "Visitors"
                ],
                "summary": "Get visitor list by client ID",
                "description": "Returns a paginated list of visitors filtered by date range and optional search value.",
                "operationId": "getVisitorsByClient",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Start date in Y-m-d format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-05-01"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "End date in Y-m-d format",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-05-31"
                        }
                    },
                    {
                        "name": "page_number",
                        "in": "query",
                        "description": "Current page number",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "length",
                        "in": "query",
                        "description": "Number of records per page",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 10
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "description": "Offset for pagination",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 0
                        }
                    },
                    {
                        "name": "search[value]",
                        "in": "query",
                        "description": "Optional search string",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "example search term"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response with visitor data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "BusinessList": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "total": {
                                            "type": "integer",
                                            "example": 150
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/visitor/{id}": {
            "get": {
                "tags": [
                    "Visitors"
                ],
                "summary": "Get visitor details",
                "description": "Fetches detailed information of a visitor based on the provided ID.",
                "operationId": "getVisitorDetails",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Visitor ID to fetch details",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 101
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Visitor details retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request or missing ID parameter",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid request"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/visitor/get-list-of-sites": {
            "get": {
                "tags": [
                    "Visitors"
                ],
                "summary": "Get all site data",
                "description": "Fetches a list of all sites available for the authenticated client's call tracking.",
                "operationId": "getAllSites",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Optional site ID filter",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 123
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of sites retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - access token missing or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Not authenticated yet."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-user-exist-on-brizy": {
            "post": {
                "tags": [
                    "Website Builder"
                ],
                "summary": "Check if user exists on Brizy and create if not",
                "operationId": "d79ea4fd2c2cfbf22f0da8e0214de424",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User ID to check",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User checked successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "login_url": {
                                            "type": "string",
                                            "example": "https://brizy.telagus.com/multipass/123?token=abc123"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/templates": {
            "get": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Get all website templates",
                "operationId": "db5a79c9dac8b12e8b836d6d066526a6",
                "responses": {
                    "200": {
                        "description": "List of all website templates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                }
            },
            "post": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Create a new website template",
                "operationId": "36eccac1a4b17853d0cee0f8a247ac3f",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Content of the template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "thumbnail",
                        "in": "query",
                        "description": "Thumbnail URL of the template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/templates/{id}": {
            "get": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Get a specific website template",
                "operationId": "19070c0733fc62a062e3967f09f51630",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the template",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                }
            },
            "put": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Update a website template",
                "operationId": "faec23642dbdd27e799d9c0c39941574",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the template to update",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Name of the template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Content of the template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "thumbnail",
                        "in": "query",
                        "description": "Thumbnail URL of the template",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Delete a website template",
                "operationId": "d4a5f19fd4063867c51254d5840a3268",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the template to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Template deleted successfully"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                }
            }
        },
        "/api/get-all-website-templates": {
            "get": {
                "tags": [
                    "Website Templates"
                ],
                "summary": "Get all website templates with specific fields",
                "operationId": "e231ca00d5a2b91a37f5cec0523864ad",
                "responses": {
                    "200": {
                        "description": "List of website templates with specific fields",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "websiteTemplate": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "client_id": {
                                                        "type": "integer"
                                                    },
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "thumbnail": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "websiteBuilderLimit": {
                                            "type": "integer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "404": {
                        "description": "Website Template Not Found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/store-wa-business-information": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Store WhatsApp Business information",
                "operationId": "d0551387c534bd9fbac303edb12ca3e2",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code from Facebook",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phone_number_id",
                        "in": "query",
                        "description": "WhatsApp phone number ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "waba_id",
                        "in": "query",
                        "description": "WhatsApp Business Account ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "WhatsApp Business Account linked successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "subscription_status": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Whatsapp Business Account Linked."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/check-wa-business-information": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Check WhatsApp Business information",
                "operationId": "2f9b9083b73a3f697208d32f0f5d3e52",
                "responses": {
                    "200": {
                        "description": "Business account information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "waba_id": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "business_phone_number": {
                                            "type": "string",
                                            "example": "+1234567890"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-wa-business-information": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Get WhatsApp Business information with datatable",
                "operationId": "f81edaff4f1ba23d8bbd39fbe5c80595",
                "responses": {
                    "200": {
                        "description": "Business account information with datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "business_list": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-wa-business-information-simple": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Get WhatsApp Business information without datatable",
                "operationId": "9294b8ca659cf039caf5ab0927c75984",
                "responses": {
                    "200": {
                        "description": "Business account information without datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "id": {
                                            "type": "integer"
                                        },
                                        "phone_number_status": {
                                            "type": "string"
                                        },
                                        "display_phone_number": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/save-wa-pin": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Set WhatsApp PIN",
                "operationId": "6dbe0fdd87b7d73c33fd80ae6d2800ed",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "WhatsApp Business ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "wpin",
                        "in": "query",
                        "description": "WhatsApp PIN",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PIN set successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-wa-pin": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Get WhatsApp PIN",
                "operationId": "36a06ccb9873631d03d57493a1ff8825",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "description": "WhatsApp Business ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "PIN retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "pin": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-wa-message": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Send WhatsApp message",
                "operationId": "28c95442c2511e28bc675a96be66a663",
                "parameters": [
                    {
                        "name": "dbId",
                        "in": "query",
                        "description": "WhatsApp Business ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Message content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to_phone",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Message sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/send-wa-message-inbox": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Send WhatsApp message for inbox",
                "operationId": "4dc3cc3dbe7f8219e8dfed1052dec468",
                "parameters": [
                    {
                        "name": "message",
                        "in": "query",
                        "description": "Message content",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "toPhoneNumber",
                        "in": "query",
                        "description": "Recipient phone number",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Message sent successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "response": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-wa-messages": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Get WhatsApp messages",
                "operationId": "38aefd764d212cef65552bbfc0f41c40",
                "parameters": [
                    {
                        "name": "phone_number_id",
                        "in": "query",
                        "description": "Phone number ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Messages retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-specific-wa-messages": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Get specific WhatsApp messages by number",
                "operationId": "10a2649f612699fc14513950c4945d1f",
                "responses": {
                    "200": {
                        "description": "Messages retrieved successfully as datatable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/store-wa-template": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Create WhatsApp template",
                "operationId": "e7906878c2a28d8932e3cdfb9e35a7c8",
                "parameters": [
                    {
                        "name": "allData",
                        "in": "query",
                        "description": "Template data in JSON format",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "header",
                        "in": "query",
                        "description": "Header type (text, image, document, video)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "text",
                                "image",
                                "document",
                                "video"
                            ]
                        }
                    },
                    {
                        "name": "template_header_image",
                        "in": "query",
                        "description": "Header image file (if header type is image)",
                        "required": false,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "template_header_video",
                        "in": "query",
                        "description": "Header video file (if header type is video)",
                        "required": false,
                        "schema": {
                            "type": "file"
                        }
                    },
                    {
                        "name": "template_header_document",
                        "in": "query",
                        "description": "Header document file (if header type is document)",
                        "required": false,
                        "schema": {
                            "type": "file"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "object"
                                        },
                                        "access_token": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/fb-wa-notification": {
            "get": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Meta webhook verification handshake (public)",
                "description": "Unauthenticated. When the callback URL is configured in the Meta app, Meta sends this GET with hub.mode / hub.verify_token / hub.challenge (PHP receives them with underscores). The challenge is echoed back as plain text when the verify token matches — otherwise Meta will not activate the subscription and no message notifications are delivered. The POST on the same path receives the actual notifications.",
                "operationId": "c0b83ae2fbbf20665614dedc6378280e",
                "parameters": [
                    {
                        "name": "hub_mode",
                        "in": "query",
                        "description": "Sent by Meta as hub.mode; must be \"subscribe\"",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "subscribe"
                        }
                    },
                    {
                        "name": "hub_verify_token",
                        "in": "query",
                        "description": "Sent by Meta as hub.verify_token; must match the configured verify token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "hub_challenge",
                        "in": "query",
                        "description": "Sent by Meta as hub.challenge; echoed back on success",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The hub.challenge value as plain text",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string",
                                    "example": "1158201444"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token mismatch or bad mode (\"Forbidden\" as plain text)"
                    }
                }
            },
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Receive WhatsApp webhook notification",
                "operationId": "d53fee7646cab1884b91ba95045f2c42",
                "responses": {
                    "200": {
                        "description": "Notification processed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/add-whatsapp-message-notification": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Add WhatsApp message notification",
                "operationId": "34b7c2657cc436557710db62e345a29c",
                "parameters": [
                    {
                        "name": "userId",
                        "in": "query",
                        "description": "User ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notification added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "messages": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Error occurred"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/template/send-single": {
            "post": {
                "tags": [
                    "Whatsapp Business"
                ],
                "summary": "Send an approved WhatsApp template message to a single recipient",
                "description": "Looks up the template + WABA for the authenticated user's client and dispatches the message via the WhatsApp Cloud API. The template must be in APPROVED status; English (en_GB) language code is hard-coded.",
                "operationId": "whatsappSendTemplateSingle",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "template_id",
                                    "to_phone"
                                ],
                                "properties": {
                                    "template_id": {
                                        "description": "ID of the whatsapp_template row",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "to_phone": {
                                        "description": "Recipient phone in E.164 format",
                                        "type": "string",
                                        "example": "+447123456789"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Either send-success OR a soft failure (no WABA / template not found / not approved / WA API error). Always 200 — inspect `success`.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Unexpected server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/readiness-status": {
            "get": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Check WhatsApp Business Account readiness",
                "description": "Returns send-readiness for every active WABA on the authenticated user's client. Each account includes blockers (no_waba, needs_pin, etc.), Meta profile fields, and cache state. Top-level fields mirror the primary (first) account for backward compatibility.",
                "operationId": "whatsappReadinessStatus",
                "parameters": [
                    {
                        "name": "force",
                        "in": "query",
                        "description": "When true, busts the readiness cache and re-fetches live status from Meta",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Readiness payload (always 200 — inspect `success` / `ready`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "ready": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "blocker": {
                                            "type": "string",
                                            "example": "needs_pin",
                                            "nullable": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "waba_db_id": {
                                            "type": "integer",
                                            "example": 1,
                                            "nullable": true
                                        },
                                        "waba_id": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "phone_number_id": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "display_phone_number": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "verified_name": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "name_status": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "code_verification_status": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "accounts": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "waba_db_id": {
                                                        "type": "integer"
                                                    },
                                                    "waba_id": {
                                                        "type": "string"
                                                    },
                                                    "phone_number_id": {
                                                        "type": "string"
                                                    },
                                                    "ready": {
                                                        "type": "boolean"
                                                    },
                                                    "blocker": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "message": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "display_phone_number": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "verified_name": {
                                                        "type": "string",
                                                        "nullable": true
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/disconnect": {
            "post": {
                "tags": [
                    "WhatsApp Business"
                ],
                "summary": "Disconnect the active WhatsApp Business Account",
                "description": "Soft-deletes the authenticated user's client's active WABA and clears its readiness/blocker caches so a new account can be linked.",
                "operationId": "whatsappDisconnect",
                "responses": {
                    "200": {
                        "description": "Disconnect attempted (always 200 — inspect `success`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "WhatsApp Business Account disconnected. You can now connect a different account."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "500": {
                        "description": "Unexpected server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-whatsapp-templates": {
            "post": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Get whatsapp templates for the authenticated user's client",
                "operationId": "f190381ffd502ea0c0e71ca1ef66da2d",
                "responses": {
                    "200": {
                        "description": "Whatsapp templates retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/get-whatsapp-template": {
            "get": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Get and refresh whatsapp templates from the Facebook API",
                "operationId": "fb31eca60f2b87a02f4913cf20aea095",
                "responses": {
                    "200": {
                        "description": "Whatsapp templates refreshed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "templates": {
                                            "type": "string",
                                            "example": "Whatsapp Templates Refreshed"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/delete-whatsapp-template/{id}": {
            "delete": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Delete a whatsapp template",
                "operationId": "a89293e29ef9bb1d53e78ee3edb87fef",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the whatsapp template to delete",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Whatsapp template deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Whatsapp Template Deleted Successfully"
                                        },
                                        "template": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/template/send": {
            "post": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Send whatsapp template messages to leads",
                "operationId": "a0800f3b3c543823591b38c24678a3aa",
                "parameters": [
                    {
                        "name": "template_id",
                        "in": "query",
                        "description": "ID of the whatsapp template to send",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "example": 1
                        }
                    },
                    {
                        "name": "list_selection_type",
                        "in": "query",
                        "description": "Type of selection (all_selected or filtered)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "all_selected"
                        }
                    },
                    {
                        "name": "mobiles_list",
                        "in": "query",
                        "description": "Array of mobile numbers (required if list_selection_type is all_selected)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "Array of lead IDs (required if list_selection_type is all_selected)",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "schedule_time",
                        "in": "query",
                        "description": "Time to schedule the message (optional)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "includes",
                        "in": "query",
                        "description": "Filter parameters for includes",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "not_include",
                        "in": "query",
                        "description": "Filter parameters for not includes",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_equal_to",
                        "in": "query",
                        "description": "Filter parameters for equality",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_equal_to",
                        "in": "query",
                        "description": "Filter parameters for inequality",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_empty",
                        "in": "query",
                        "description": "Filter parameters for empty fields",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "is_not_empty",
                        "in": "query",
                        "description": "Filter parameters for non-empty fields",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Filter parameters for date",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date_between",
                        "in": "query",
                        "description": "Filter parameters for date range",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Search term for filtering leads",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Whatsapp messages scheduled successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Whatsapp messages will go out shortly."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/lead-search": {
            "post": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Search leads for WhatsApp campaigns (only leads with a mobile number)",
                "operationId": "ea9a41cb90de6246a5fe1750cce0fcc2",
                "responses": {
                    "200": {
                        "description": "DataTables-formatted lead list"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/template/{templateId}/report": {
            "get": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "Get aggregated tracking report for a WhatsApp template",
                "operationId": "ca5d8be974c09f4f9897a71efc37e042",
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Report summary"
                    },
                    "404": {
                        "description": "Template not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/whatsapp/template/{templateId}/report/recipients": {
            "post": {
                "tags": [
                    "Whatsapp Templates"
                ],
                "summary": "DataTables-friendly per-recipient list for a template",
                "operationId": "12657ecee1df97c73b72a7906bfb7ef0",
                "parameters": [
                    {
                        "name": "templateId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "DataTables JSON"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/dashboard/invoices-owed": {
            "get": {
                "tags": [
                    "Xero Dashboard"
                ],
                "summary": "Get dashboard data for invoices owed to the user",
                "operationId": "8e6c43e42a51359d7a3bfc7a273ae35e",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Optional client ID to scope the Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Optional start date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Optional end date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoices owed dashboard data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invoices owed dashboard data retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated or Xero connection expired"
                    },
                    "404": {
                        "description": "No active Xero connection found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/dashboard/bills-to-pay": {
            "get": {
                "tags": [
                    "Xero Dashboard"
                ],
                "summary": "Get dashboard data for bills the user needs to pay",
                "operationId": "a5100e56c016cd09d210501a47ce6c00",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Optional client ID to scope the Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Optional start date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Optional end date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bills to pay dashboard data retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Bills to pay dashboard data retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated or Xero connection expired"
                    },
                    "404": {
                        "description": "No active Xero connection found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/dashboard/overview": {
            "get": {
                "tags": [
                    "Xero Dashboard"
                ],
                "summary": "Get combined Xero dashboard overview (invoices owed and bills to pay)",
                "operationId": "21086fc6457b1158e83729490969ab34",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Optional client ID to scope the Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Optional start date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "Optional end date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dashboard overview retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Dashboard overview retrieved successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "invoices_owed": {
                                                    "type": "object"
                                                },
                                                "bills_to_pay": {
                                                    "type": "object"
                                                },
                                                "summary": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated or Xero connection expired"
                    },
                    "404": {
                        "description": "No active Xero connection found"
                    },
                    "500": {
                        "description": "Server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/aged-payables-summary": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Aged Payables Summary Report",
                "description": "Get Aged Payables Summary Report",
                "operationId": "be4402bc527867fbf0ee6f909e96636c",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Report date (YYYY-MM-DD format). Defaults to today.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-10-31"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "From date filter (YYYY-MM-DD format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "To date filter (YYYY-MM-DD format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "aging_periods",
                        "in": "query",
                        "description": "Number of aging periods to create (2-10). Defaults to 4.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 4,
                            "maximum": 10,
                            "minimum": 2
                        }
                    },
                    {
                        "name": "period_type",
                        "in": "query",
                        "description": "Type of aging period: month, week, or day. Defaults to 'month'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "month",
                            "enum": [
                                "month",
                                "week",
                                "day"
                            ]
                        }
                    },
                    {
                        "name": "period_title_format",
                        "in": "query",
                        "description": "Format for period titles: 'period_number' (e.g. 'Current', '1 Month') or 'date_range' (e.g. 'Jan 2024'). Defaults to 'period_number'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "period_number",
                            "enum": [
                                "period_number",
                                "date_range"
                            ]
                        }
                    },
                    {
                        "name": "include_report_date_in_current",
                        "in": "query",
                        "description": "Whether to include items due on the report date in the 'Current' period. Defaults to true.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "columns",
                        "in": "query",
                        "description": "Array of columns to include in the response. Available options: aging_periods, contact, contact_account_number, contact_group, email, mobile, outstanding_tax, phone, primary_person, total. If not provided, all columns will be included.",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "enum": [
                                    "aging_periods",
                                    "contact",
                                    "contact_account_number",
                                    "contact_group",
                                    "email",
                                    "mobile",
                                    "outstanding_tax",
                                    "phone",
                                    "primary_person",
                                    "total"
                                ]
                            },
                            "example": [
                                "contact",
                                "aging_periods",
                                "total"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Aged payables summary report retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Aged payables summary report retrieved successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "report_name": {
                                                    "type": "string",
                                                    "example": "Aged Payables Summary"
                                                },
                                                "organization_name": {
                                                    "type": "string",
                                                    "example": "Telagus Xero"
                                                },
                                                "as_at_date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "2025-10-31"
                                                },
                                                "aging_by": {
                                                    "type": "string",
                                                    "example": "Due Date"
                                                },
                                                "grouping": {
                                                    "type": "string",
                                                    "example": "Document Type"
                                                },
                                                "base_currency": {
                                                    "type": "string",
                                                    "example": "USD"
                                                },
                                                "aging_configuration": {
                                                    "properties": {
                                                        "periods": {
                                                            "type": "integer",
                                                            "example": 4
                                                        },
                                                        "period_type": {
                                                            "type": "string",
                                                            "example": "month"
                                                        },
                                                        "period_title_format": {
                                                            "type": "string",
                                                            "example": "period_number"
                                                        },
                                                        "include_report_date_in_current": {
                                                            "type": "boolean",
                                                            "example": true
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "column_configuration": {
                                                    "properties": {
                                                        "available_columns": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "example": [
                                                                "aging_periods",
                                                                "contact",
                                                                "contact_account_number",
                                                                "contact_group",
                                                                "email",
                                                                "mobile",
                                                                "outstanding_tax",
                                                                "phone",
                                                                "primary_person",
                                                                "total"
                                                            ]
                                                        },
                                                        "selected_columns": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "example": [
                                                                "contact",
                                                                "aging_periods",
                                                                "total"
                                                            ]
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "aging_periods": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "key": {
                                                                "type": "string",
                                                                "example": "period_0"
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Current"
                                                            },
                                                            "description": {
                                                                "type": "string",
                                                                "example": "Not yet due"
                                                            },
                                                            "period_index": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "currencies_used": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "example": [
                                                        "USD",
                                                        "EUR",
                                                        "GBP"
                                                    ]
                                                },
                                                "contacts": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "contact_name": {
                                                                "description": "Contact name (if 'contact' column selected)",
                                                                "type": "string",
                                                                "example": "Indrajit Kaplatya"
                                                            },
                                                            "contact_account_number": {
                                                                "description": "Contact account number (if 'contact_account_number' column selected)",
                                                                "type": "string",
                                                                "example": "ACC001"
                                                            },
                                                            "contact_group": {
                                                                "description": "Contact group (if 'contact_group' column selected)",
                                                                "type": "string",
                                                                "example": "Suppliers"
                                                            },
                                                            "email": {
                                                                "description": "Contact email (if 'email' column selected)",
                                                                "type": "string",
                                                                "example": "contact@example.com"
                                                            },
                                                            "mobile": {
                                                                "description": "Contact mobile (if 'mobile' column selected)",
                                                                "type": "string",
                                                                "example": "+1 555-0123"
                                                            },
                                                            "phone": {
                                                                "description": "Contact phone (if 'phone' column selected)",
                                                                "type": "string",
                                                                "example": "+1 555-0456"
                                                            },
                                                            "primary_person": {
                                                                "description": "Primary contact person (if 'primary_person' column selected)",
                                                                "type": "string",
                                                                "example": "John Doe"
                                                            },
                                                            "currency": {
                                                                "type": "string",
                                                                "example": "USD"
                                                            },
                                                            "period_0": {
                                                                "description": "Current period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 250
                                                            },
                                                            "period_1": {
                                                                "description": "First aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 0
                                                            },
                                                            "period_2": {
                                                                "description": "Second aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 0
                                                            },
                                                            "period_3": {
                                                                "description": "Third aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 0
                                                            },
                                                            "total": {
                                                                "description": "Total amount (if 'total' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 250
                                                            },
                                                            "outstanding_tax": {
                                                                "description": "Outstanding tax amount (if 'outstanding_tax' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 25
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "summary": {
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string",
                                                            "example": "USD"
                                                        },
                                                        "period_0": {
                                                            "description": "Current period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 7751
                                                        },
                                                        "period_1": {
                                                            "description": "First aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 250
                                                        },
                                                        "period_2": {
                                                            "description": "Second aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 0
                                                        },
                                                        "period_3": {
                                                            "description": "Third aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 0
                                                        },
                                                        "total": {
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 8001
                                                        },
                                                        "period_0_percentage": {
                                                            "description": "Current period percentage",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 96.88
                                                        },
                                                        "period_1_percentage": {
                                                            "description": "First aging period percentage",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 3.12
                                                        },
                                                        "percentage_of_total": {
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 100
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No active Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve aged payables summary report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/aged-receivables-summary": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Aged Receivables Summary Report",
                "description": "Get Aged Receivables Summary Report",
                "operationId": "ef75413f4e5651ea5e8123c246dc0bd6",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Report date (YYYY-MM-DD format). Defaults to today.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-10-31"
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "From date filter (YYYY-MM-DD format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "To date filter (YYYY-MM-DD format)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "aging_periods",
                        "in": "query",
                        "description": "Number of aging periods to create (2-10). Defaults to 4.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 4,
                            "maximum": 10,
                            "minimum": 2
                        }
                    },
                    {
                        "name": "period_type",
                        "in": "query",
                        "description": "Type of aging period: month, week, or day. Defaults to 'month'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "month",
                            "enum": [
                                "month",
                                "week",
                                "day"
                            ]
                        }
                    },
                    {
                        "name": "period_title_format",
                        "in": "query",
                        "description": "Format for period titles: 'period_number' (e.g. 'Current', '1 Month') or 'date_range' (e.g. 'Jan 2024'). Defaults to 'period_number'.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "period_number",
                            "enum": [
                                "period_number",
                                "date_range"
                            ]
                        }
                    },
                    {
                        "name": "include_report_date_in_current",
                        "in": "query",
                        "description": "Whether to include items due on the report date in the 'Current' period. Defaults to true.",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "example": true
                        }
                    },
                    {
                        "name": "columns",
                        "in": "query",
                        "description": "Array of columns to include in the response. Available options: aging_periods, contact, contact_account_number, contact_group, email, mobile, outstanding_tax, phone, primary_person, total. If not provided, all columns will be included.",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "enum": [
                                    "aging_periods",
                                    "contact",
                                    "contact_account_number",
                                    "contact_group",
                                    "email",
                                    "mobile",
                                    "outstanding_tax",
                                    "phone",
                                    "primary_person",
                                    "total"
                                ]
                            },
                            "example": [
                                "contact",
                                "aging_periods",
                                "total"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Aged receivables summary report retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Aged receivables summary report retrieved successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "report_name": {
                                                    "type": "string",
                                                    "example": "Aged Receivables Summary"
                                                },
                                                "organization_name": {
                                                    "type": "string",
                                                    "example": "Telagus Xero"
                                                },
                                                "as_at_date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "2025-10-31"
                                                },
                                                "aging_by": {
                                                    "type": "string",
                                                    "example": "Due Date"
                                                },
                                                "grouping": {
                                                    "type": "string",
                                                    "example": "Document Type"
                                                },
                                                "base_currency": {
                                                    "type": "string",
                                                    "example": "USD"
                                                },
                                                "aging_configuration": {
                                                    "properties": {
                                                        "periods": {
                                                            "type": "integer",
                                                            "example": 4
                                                        },
                                                        "period_type": {
                                                            "type": "string",
                                                            "example": "month"
                                                        },
                                                        "period_title_format": {
                                                            "type": "string",
                                                            "example": "period_number"
                                                        },
                                                        "include_report_date_in_current": {
                                                            "type": "boolean",
                                                            "example": true
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "column_configuration": {
                                                    "properties": {
                                                        "available_columns": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "example": [
                                                                "aging_periods",
                                                                "contact",
                                                                "contact_account_number",
                                                                "contact_group",
                                                                "email",
                                                                "mobile",
                                                                "outstanding_tax",
                                                                "phone",
                                                                "primary_person",
                                                                "total"
                                                            ]
                                                        },
                                                        "selected_columns": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "example": [
                                                                "contact",
                                                                "aging_periods",
                                                                "total"
                                                            ]
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "aging_periods": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "key": {
                                                                "type": "string",
                                                                "example": "period_0"
                                                            },
                                                            "title": {
                                                                "type": "string",
                                                                "example": "Current"
                                                            },
                                                            "description": {
                                                                "type": "string",
                                                                "example": "Not yet due"
                                                            },
                                                            "period_index": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "currencies_used": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "example": [
                                                        "USD",
                                                        "EUR",
                                                        "GBP"
                                                    ]
                                                },
                                                "contacts": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "contact_name": {
                                                                "description": "Contact name (if 'contact' column selected)",
                                                                "type": "string",
                                                                "example": "John Smith Ltd"
                                                            },
                                                            "contact_account_number": {
                                                                "description": "Contact account number (if 'contact_account_number' column selected)",
                                                                "type": "string",
                                                                "example": "CUST001"
                                                            },
                                                            "contact_group": {
                                                                "description": "Contact group (if 'contact_group' column selected)",
                                                                "type": "string",
                                                                "example": "Customers"
                                                            },
                                                            "email": {
                                                                "description": "Contact email (if 'email' column selected)",
                                                                "type": "string",
                                                                "example": "john@example.com"
                                                            },
                                                            "mobile": {
                                                                "description": "Contact mobile (if 'mobile' column selected)",
                                                                "type": "string",
                                                                "example": "+1 555-0123"
                                                            },
                                                            "phone": {
                                                                "description": "Contact phone (if 'phone' column selected)",
                                                                "type": "string",
                                                                "example": "+1 555-0456"
                                                            },
                                                            "primary_person": {
                                                                "description": "Primary contact person (if 'primary_person' column selected)",
                                                                "type": "string",
                                                                "example": "John Smith"
                                                            },
                                                            "currency": {
                                                                "type": "string",
                                                                "example": "USD"
                                                            },
                                                            "period_0": {
                                                                "description": "Current period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 1500
                                                            },
                                                            "period_1": {
                                                                "description": "First aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 750
                                                            },
                                                            "period_2": {
                                                                "description": "Second aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 0
                                                            },
                                                            "period_3": {
                                                                "description": "Third aging period amount (if 'aging_periods' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 0
                                                            },
                                                            "total": {
                                                                "description": "Total amount (if 'total' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 2250
                                                            },
                                                            "outstanding_tax": {
                                                                "description": "Outstanding tax amount (if 'outstanding_tax' column selected)",
                                                                "type": "number",
                                                                "format": "float",
                                                                "example": 225
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "summary": {
                                                    "properties": {
                                                        "currency": {
                                                            "type": "string",
                                                            "example": "USD"
                                                        },
                                                        "period_0": {
                                                            "description": "Current period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 15000
                                                        },
                                                        "period_1": {
                                                            "description": "First aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 5000
                                                        },
                                                        "period_2": {
                                                            "description": "Second aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 2500
                                                        },
                                                        "period_3": {
                                                            "description": "Third aging period total",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 1000
                                                        },
                                                        "total": {
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 23500
                                                        },
                                                        "period_0_percentage": {
                                                            "description": "Current period percentage",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 63.83
                                                        },
                                                        "period_1_percentage": {
                                                            "description": "First aging period percentage",
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 21.28
                                                        },
                                                        "percentage_of_total": {
                                                            "type": "number",
                                                            "format": "float",
                                                            "example": 100
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No active Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve aged receivables summary report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/executive-summary": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Executive Summary Report",
                "description": "Generate a comprehensive executive summary report combining data from Xero Balance Sheet and Profit & Loss reports, including cash, profitability, balance sheet, sales, performance, and position metrics with comparison to previous periods.",
                "operationId": "eebafee3511c4b3b9fe315f7f9c1d943",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "current_date",
                        "in": "query",
                        "description": "Date for the current period report (YYYY-MM-DD format). Defaults to today.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2025-11-30"
                        }
                    },
                    {
                        "name": "compare_with",
                        "in": "query",
                        "description": "Comparison period type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "previous_month",
                            "enum": [
                                "previous_month",
                                "previous_quarter",
                                "previous_year",
                                "same_month_last_year"
                            ]
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code for the report (3-letter ISO code)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "INR",
                            "default": "INR"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Executive summary report retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Executive summary report retrieved successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "organization_name": {
                                                    "type": "string",
                                                    "example": "Telagus 2410"
                                                },
                                                "report_date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "2025-11-30"
                                                },
                                                "comparison_date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "2025-10-31"
                                                },
                                                "comparison_type": {
                                                    "type": "string",
                                                    "example": "previous_month"
                                                },
                                                "currency": {
                                                    "type": "string",
                                                    "example": "INR"
                                                },
                                                "date_range": {
                                                    "properties": {
                                                        "current": {
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "label": {
                                                                    "type": "string",
                                                                    "example": "Nov 2025"
                                                                }
                                                            },
                                                            "type": "object"
                                                        },
                                                        "comparison": {
                                                            "properties": {
                                                                "from": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "to": {
                                                                    "type": "string",
                                                                    "format": "date"
                                                                },
                                                                "label": {
                                                                    "type": "string",
                                                                    "example": "Oct 2025"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "cash": {
                                                    "properties": {
                                                        "cash_received": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "profitability": {
                                                    "properties": {
                                                        "income": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "balance_sheet": {
                                                    "properties": {
                                                        "debtors": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "sales": {
                                                    "properties": {
                                                        "number_of_invoices_issued": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "performance": {
                                                    "properties": {
                                                        "gross_profit_margin_percentage": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "position": {
                                                    "properties": {
                                                        "average_debtor_days": {
                                                            "properties": {
                                                                "current": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "comparison": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                },
                                                                "variance_percentage": {
                                                                    "type": "number",
                                                                    "format": "float",
                                                                    "nullable": true
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - Invalid parameters"
                    },
                    "401": {
                        "description": "Unauthorized - User not authenticated"
                    },
                    "404": {
                        "description": "Xero connection not found"
                    },
                    "500": {
                        "description": "Internal server error - Failed to retrieve executive summary report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/executive-summary-filter-options": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get filter options for Executive Summary Report",
                "operationId": "730fc1789a987962d57d06568eb39c3f",
                "responses": {
                    "200": {
                        "description": "Executive summary filter options retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Executive summary filter options retrieved successfully"
                                        },
                                        "data": {
                                            "type": "object",
                                            "nullable": true
                                        },
                                        "filter_options": {
                                            "properties": {
                                                "comparison_types": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "value": {
                                                                "type": "string",
                                                                "example": "previous_month"
                                                            },
                                                            "label": {
                                                                "type": "string",
                                                                "example": "Previous Month"
                                                            },
                                                            "description": {
                                                                "type": "string",
                                                                "example": "Compare with the previous month"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "currencies": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "code": {
                                                                "type": "string",
                                                                "example": "INR"
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "example": "Indian Rupee"
                                                            },
                                                            "symbol": {
                                                                "type": "string",
                                                                "example": "₹"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "date_suggestions": {
                                                    "properties": {
                                                        "current_month_end": {
                                                            "type": "string",
                                                            "example": "2025-11-30"
                                                        },
                                                        "previous_month_end": {
                                                            "type": "string",
                                                            "example": "2025-10-31"
                                                        },
                                                        "current_quarter_end": {
                                                            "type": "string",
                                                            "example": "2025-12-31"
                                                        },
                                                        "previous_quarter_end": {
                                                            "type": "string",
                                                            "example": "2025-09-30"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/callback": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Handle Xero OAuth callback",
                "description": "Handles the OAuth 2.0 callback from Xero. Exchanges the authorization code for tokens and saves the connection. May redirect to the frontend or return JSON depending on the Accept header.",
                "operationId": "e2f762ce4a3d0411679520f4fd2a2449",
                "parameters": [
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Authorization code returned by Xero",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "Base64-encoded state parameter containing user_id and client_id",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "error",
                        "in": "query",
                        "description": "Error code returned by Xero when authorization fails",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "error_description",
                        "in": "query",
                        "description": "Human-readable error description from Xero",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero connection established successfully (JSON) or redirect to frontend success URL"
                    },
                    "400": {
                        "description": "OAuth authorization failed"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "422": {
                        "description": "No authorization code received"
                    },
                    "500": {
                        "description": "Failed to establish Xero connection"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/auth-url": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Xero authorization URL",
                "description": "Generates the Xero OAuth 2.0 authorization URL for the authenticated user.",
                "operationId": "719918ed37c4d69f82201dceccc5ded2",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Authorization URL generated successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "500": {
                        "description": "Failed to generate authorization URL"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/disconnect": {
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Disconnect Xero connection",
                "description": "Removes the stored Xero OAuth connection for the authenticated user.",
                "operationId": "308020ab644ef00acb67a7c907f2c073",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero connection disconnected successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to disconnect Xero connection"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/connection-status": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Xero connection status",
                "description": "Returns the current Xero connection status for the authenticated user, including token validity and any re-authentication requirements.",
                "operationId": "f26d5d9865ac00ffe9acdc0d83e0f328",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Connection status retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "500": {
                        "description": "Failed to get connection status"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/refresh-token": {
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Refresh Xero access token",
                "description": "Refreshes the Xero OAuth access token using the stored refresh token.",
                "operationId": "e7850e6717e852b99f2fa874f0cf4ae1",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Token refreshed successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to refresh token"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/organization": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Xero organization details",
                "description": "Retrieves details of the connected Xero organization (tenant).",
                "operationId": "3d1d9b15d2ea009ec266a7acff70c8e3",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Organization details retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get organization details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/contacts": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero contacts",
                "description": "Lists Xero contacts with optional filtering, search, and pagination.",
                "operationId": "a18c128625cc3f3cfbdb4ee645b0a67f",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "description": "Xero filter expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Sort order expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_archived",
                        "in": "query",
                        "description": "Whether to include archived contacts",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "summary_only",
                        "in": "query",
                        "description": "Return summary fields only",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search_term",
                        "in": "query",
                        "description": "Free-text search term",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "include_total_count",
                        "in": "query",
                        "description": "Include total count in pagination response",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_balances",
                        "in": "query",
                        "description": "Include balance information for each contact",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contacts retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get contacts"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Create a Xero contact",
                "description": "Creates a new contact in Xero with the supplied details.",
                "operationId": "d910f696eeb1bb2ead2572144737a36a",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Contact name (max 255 characters)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "account_number",
                        "in": "query",
                        "description": "Contact account number",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 50
                        }
                    },
                    {
                        "name": "primary_person",
                        "in": "query",
                        "description": "Primary person details (first_name, last_name, email)",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "additional_people",
                        "in": "query",
                        "description": "Additional contact people",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number object (country, area, number)",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "fax_number",
                        "in": "query",
                        "description": "Fax number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "direct_dial_number",
                        "in": "query",
                        "description": "Direct dial number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "website",
                        "in": "query",
                        "description": "Contact website URL",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    },
                    {
                        "name": "business_registration_number",
                        "in": "query",
                        "description": "Business registration number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Free-form notes",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000
                        }
                    },
                    {
                        "name": "billing_address",
                        "in": "query",
                        "description": "Billing address object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "delivery_address",
                        "in": "query",
                        "description": "Delivery address object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "bank_account_name",
                        "in": "query",
                        "description": "Bank account name",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bank_account_number",
                        "in": "query",
                        "description": "Bank account number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "details",
                        "in": "query",
                        "description": "Bank payment details",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tax_id_number",
                        "in": "query",
                        "description": "Tax identification number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Default currency (3-letter ISO code)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 3,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "sales_account",
                        "in": "query",
                        "description": "Default sales account code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invoice_due_date",
                        "in": "query",
                        "description": "Default invoice due days (1-365)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 365,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "amounts_are",
                        "in": "query",
                        "description": "Sales amounts tax treatment",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "INCLUSIVE",
                                "EXCLUSIVE",
                                "NOTAX"
                            ]
                        }
                    },
                    {
                        "name": "sales_tax",
                        "in": "query",
                        "description": "Default sales tax type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "discount",
                        "in": "query",
                        "description": "Default sales discount percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "maximum": 100,
                            "minimum": 0
                        }
                    },
                    {
                        "name": "credit_limit_amount",
                        "in": "query",
                        "description": "Customer credit limit amount",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "xero_network_key",
                        "in": "query",
                        "description": "Xero network key",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "purchase_account",
                        "in": "query",
                        "description": "Default purchase account code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bill_due_date",
                        "in": "query",
                        "description": "Default bill due days (1-365)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 365,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "purchase_amounts_are",
                        "in": "query",
                        "description": "Purchase amounts tax treatment",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "INCLUSIVE",
                                "EXCLUSIVE",
                                "NOTAX"
                            ]
                        }
                    },
                    {
                        "name": "purchase_tax",
                        "in": "query",
                        "description": "Default purchase tax type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Contact created successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to create contact"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/contacts/{contactId}": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get a single Xero contact",
                "description": "Retrieves a single Xero contact by its UUID.",
                "operationId": "1975eccc5d1292220d664be4a646ef08",
                "parameters": [
                    {
                        "name": "contactId",
                        "in": "path",
                        "description": "Xero contact UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact retrieved successfully"
                    },
                    "400": {
                        "description": "Invalid contact ID format"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "Contact or Xero connection not found"
                    },
                    "500": {
                        "description": "Failed to get contact"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Update a Xero contact",
                "description": "Updates an existing Xero contact identified by its UUID.",
                "operationId": "e629d8751c16b611d75132e64e4f1e18",
                "parameters": [
                    {
                        "name": "contactId",
                        "in": "path",
                        "description": "Xero contact UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Contact name",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    },
                    {
                        "name": "account_number",
                        "in": "query",
                        "description": "Contact account number",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 50
                        }
                    },
                    {
                        "name": "primary_person",
                        "in": "query",
                        "description": "Primary person details (first_name, last_name, email)",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "email_address",
                        "in": "query",
                        "description": "Contact email (backward compatibility)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "additional_people",
                        "in": "query",
                        "description": "Additional contact people",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    },
                    {
                        "name": "phone_number",
                        "in": "query",
                        "description": "Phone number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "fax_number",
                        "in": "query",
                        "description": "Fax number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "mobile_number",
                        "in": "query",
                        "description": "Mobile number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "direct_dial_number",
                        "in": "query",
                        "description": "Direct dial number object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "website",
                        "in": "query",
                        "description": "Contact website URL",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "url"
                        }
                    },
                    {
                        "name": "business_registration_number",
                        "in": "query",
                        "description": "Business registration number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "notes",
                        "in": "query",
                        "description": "Free-form notes",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 1000
                        }
                    },
                    {
                        "name": "billing_address",
                        "in": "query",
                        "description": "Billing address object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "delivery_address",
                        "in": "query",
                        "description": "Delivery address object",
                        "required": false,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "bank_account_name",
                        "in": "query",
                        "description": "Bank account name",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bank_account_number",
                        "in": "query",
                        "description": "Bank account number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "details",
                        "in": "query",
                        "description": "Bank payment details",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tax_id_number",
                        "in": "query",
                        "description": "Tax identification number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Default currency (3-letter ISO code)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 3,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "sales_account",
                        "in": "query",
                        "description": "Default sales account code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "invoice_due_date",
                        "in": "query",
                        "description": "Default invoice due days",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 365,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "amounts_are",
                        "in": "query",
                        "description": "Sales amounts tax treatment",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "INCLUSIVE",
                                "EXCLUSIVE",
                                "NOTAX"
                            ]
                        }
                    },
                    {
                        "name": "sales_tax",
                        "in": "query",
                        "description": "Default sales tax type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "discount",
                        "in": "query",
                        "description": "Default sales discount percentage",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "maximum": 100,
                            "minimum": 0
                        }
                    },
                    {
                        "name": "credit_limit_amount",
                        "in": "query",
                        "description": "Customer credit limit amount",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "xero_network_key",
                        "in": "query",
                        "description": "Xero network key",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "purchase_account",
                        "in": "query",
                        "description": "Default purchase account code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "bill_due_date",
                        "in": "query",
                        "description": "Default bill due days",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 365,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "purchase_amounts_are",
                        "in": "query",
                        "description": "Purchase amounts tax treatment",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "INCLUSIVE",
                                "EXCLUSIVE",
                                "NOTAX"
                            ]
                        }
                    },
                    {
                        "name": "purchase_tax",
                        "in": "query",
                        "description": "Default purchase tax type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_customer",
                        "in": "query",
                        "description": "Whether the contact is a customer",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "is_supplier",
                        "in": "query",
                        "description": "Whether the contact is a supplier",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "contact_status",
                        "in": "query",
                        "description": "Contact status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ACTIVE",
                                "ARCHIVED"
                            ]
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact updated successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to update contact"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Archive a Xero contact",
                "description": "Archives (soft-deletes) a Xero contact by setting its status to ARCHIVED. Xero does not permanently delete contacts.",
                "operationId": "f8a5090d26a8b55242732db085ec4559",
                "parameters": [
                    {
                        "name": "contactId",
                        "in": "path",
                        "description": "Xero contact UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact archived successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to delete contact"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero invoices",
                "description": "Lists Xero invoices with filtering, search, and pagination. Optionally filter by status_filter (draft, awaiting-approval, awaiting-payment, paid, repeating, all).",
                "operationId": "c8657a90b1670e8b076088e7a9c46de8",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "description": "Xero filter expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Sort order expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "include_archived",
                        "in": "query",
                        "description": "Include archived invoices",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "created_by_my_app",
                        "in": "query",
                        "description": "Only invoices created by this application",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "unitdp",
                        "in": "query",
                        "description": "Unit decimal places",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "summary_only",
                        "in": "query",
                        "description": "Return summary fields only",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_total_count",
                        "in": "query",
                        "description": "Include total count in pagination response",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search_query",
                        "in": "query",
                        "description": "Free-text search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search_within",
                        "in": "query",
                        "description": "Date field to search within (default any_date)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "any_date"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "unsent_only",
                        "in": "query",
                        "description": "Only invoices not yet sent",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_deleted_voided",
                        "in": "query",
                        "description": "Include deleted and voided invoices",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "status_filter",
                        "in": "query",
                        "description": "Filter by invoice status (e.g. draft, awaiting-approval, awaiting-payment, paid, repeating)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Create a Xero invoice",
                "description": "Creates a new invoice in Xero with line items.",
                "operationId": "e7879ab7691362fbd2c1723f6b950d47",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "description": "Xero contact UUID for the invoice",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Invoice type (default ACCREC)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "ACCREC",
                            "enum": [
                                "ACCREC",
                                "ACCPAY"
                            ]
                        }
                    },
                    {
                        "name": "invoice_number",
                        "in": "query",
                        "description": "Invoice number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Invoice reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "issue_date",
                        "in": "query",
                        "description": "Issue date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "currency_code",
                        "in": "query",
                        "description": "3-letter currency code",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 3,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Invoice status (default DRAFT)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "DRAFT",
                            "enum": [
                                "DRAFT",
                                "SUBMITTED",
                                "AUTHORISED"
                            ]
                        }
                    },
                    {
                        "name": "line_items",
                        "in": "query",
                        "description": "Array of invoice line items (description and unit_amount required)",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Invoice created successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to create invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/payments": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero payments",
                "description": "Lists Xero payments with optional filtering and pagination.",
                "operationId": "dfed6914ec8294d40a27f34b53610a02",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "description": "Xero filter expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Sort order expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "include_total_count",
                        "in": "query",
                        "description": "Include total count in pagination response",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Payments retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get payments"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/all": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List all Xero invoices",
                "description": "Lists Xero invoices without applying any status filter.",
                "operationId": "80a89261a85b521e3924c6e11d1fc628",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "search_query",
                        "in": "query",
                        "description": "Free-text search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/draft": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List draft Xero invoices",
                "description": "Lists Xero invoices filtered to DRAFT status.",
                "operationId": "06ae0aa4d2b70af8b1c779781b852ec7",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "search_query",
                        "in": "query",
                        "description": "Free-text search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Draft invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get draft invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/awaiting-approval": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List invoices awaiting approval",
                "description": "Lists Xero invoices currently awaiting approval (SUBMITTED status).",
                "operationId": "0e6893126dfb899a274b5bdbf909c98c",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Awaiting approval invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get awaiting-approval invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/awaiting-payment": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List invoices awaiting payment",
                "description": "Lists Xero invoices currently awaiting payment (AUTHORISED status).",
                "operationId": "038611806c916bb5bd221079019f7262",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Awaiting payment invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get awaiting-payment invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/paid": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List paid Xero invoices",
                "description": "Lists Xero invoices that have been paid.",
                "operationId": "20d7cfe2b1233ddf33a5c08d514e320c",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paid invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get paid invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/repeating": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List repeating Xero invoices",
                "description": "Lists Xero repeating invoice templates.",
                "operationId": "81249c5b2b0e38e33470d550f2151117",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Repeating invoices retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to get repeating invoices"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero bills",
                "description": "Lists Xero bills (purchase invoices) with optional filtering, search, and pagination.",
                "operationId": "351084f75d595ba8f9cb7272d03eff3e",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "description": "Xero filter expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Sort order expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "include_archived",
                        "in": "query",
                        "description": "Include archived bills",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "created_by_my_app",
                        "in": "query",
                        "description": "Only bills created by this application",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "unitdp",
                        "in": "query",
                        "description": "Unit decimal places",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "summary_only",
                        "in": "query",
                        "description": "Return summary fields only",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_total_count",
                        "in": "query",
                        "description": "Include total count in pagination response",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search_query",
                        "in": "query",
                        "description": "Free-text search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search_within",
                        "in": "query",
                        "description": "Date field to search within",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "unsent_only",
                        "in": "query",
                        "description": "Only bills not yet sent",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Create a Xero bill",
                "description": "Creates a new Xero bill (purchase invoice).",
                "operationId": "1d4d8c9e546926e39b77a60aea48e3ad",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contact",
                        "in": "query",
                        "description": "Contact object containing contact_id (required)",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Bill date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Bill due date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Bill reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "line_amount_types",
                        "in": "query",
                        "description": "Line amount types (e.g. Exclusive, Inclusive, NoTax)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "line_items",
                        "in": "query",
                        "description": "Array of bill line items (description, quantity, unit_amount required)",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Bill created successfully"
                    },
                    "400": {
                        "description": "Bill creation failed"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to create bill"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/all": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List all Xero bills",
                "description": "Lists Xero bills without applying a status filter.",
                "operationId": "9837f692b9fe8c8fc90008f29fb0fc09",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    },
                    {
                        "name": "search_query",
                        "in": "query",
                        "description": "Free-text search query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "Start date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "End date filter (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/draft": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List draft Xero bills",
                "description": "Lists Xero bills filtered to DRAFT status.",
                "operationId": "1b3da77fcb7fc700ad7889a3ba079b54",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Draft bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/awaiting-approval": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List bills awaiting approval",
                "description": "Lists Xero bills currently awaiting approval.",
                "operationId": "8b6a9d53c2839f78fa385a20dc38d975",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Awaiting approval bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/awaiting-payment": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List bills awaiting payment",
                "description": "Lists Xero bills currently awaiting payment.",
                "operationId": "f1e76bac3c9e386f25d36ae09682c07b",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Awaiting payment bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/paid": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List paid Xero bills",
                "description": "Lists Xero bills that have been paid.",
                "operationId": "92ee6c8fbd696521d451b333f5f2cf15",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paid bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/overdue": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List overdue Xero bills",
                "description": "Lists Xero bills that are overdue.",
                "operationId": "278f5fbbc8c9eb29eadd1ee4ecd3ec90",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number (default 1)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "page_size",
                        "in": "query",
                        "description": "Page size (default 100)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Overdue bills retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve bills"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/purchase-overview": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Xero purchase overview",
                "description": "Retrieves a summary overview of purchases from Xero.",
                "operationId": "72831dde570baffcee4f9db398daa67f",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include_archived",
                        "in": "query",
                        "description": "Include archived records (default false)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Purchase overview retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "500": {
                        "description": "Failed to retrieve purchase overview"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/items": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero items",
                "description": "Lists Xero items (products/services) with optional filtering for purchase/sale/inventory flags.",
                "operationId": "6abdabcc024529bbfd2ebac53ca10603",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "is_purchased",
                        "in": "query",
                        "description": "Filter items that can be purchased",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false",
                                "1",
                                "0"
                            ]
                        }
                    },
                    {
                        "name": "is_sold",
                        "in": "query",
                        "description": "Filter items that can be sold",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false",
                                "1",
                                "0"
                            ]
                        }
                    },
                    {
                        "name": "is_tracked_as_inventory",
                        "in": "query",
                        "description": "Filter items tracked as inventory",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false",
                                "1",
                                "0"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Items retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve items"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/items/purchased": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List purchased Xero items",
                "description": "Lists Xero items where is_purchased is true.",
                "operationId": "f9db717093ce9bcc17f3797eb0544353",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Purchased items retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve purchased items"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/items/sold": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List sold Xero items",
                "description": "Lists Xero items where is_sold is true.",
                "operationId": "0a60638d2650685c17794e3333e3ec21",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Sold items retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve sold items"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/accounts": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero accounts",
                "description": "Lists Xero chart of accounts, optionally filtered by type or a Xero where expression.",
                "operationId": "7e2d7f88f72f9c9c0487238d250cedf1",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Account type filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "REVENUE",
                                "EXPENSE",
                                "ASSET",
                                "LIABILITY",
                                "EQUITY"
                            ]
                        }
                    },
                    {
                        "name": "where",
                        "in": "query",
                        "description": "Xero filter expression",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Accounts retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve accounts"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/accounts/revenue": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero revenue accounts",
                "description": "Lists Xero revenue accounts (commonly used for invoice line items).",
                "operationId": "76c010a51ff4d932101a8f2ab17d4a95",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revenue accounts retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve revenue accounts"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/tax-rates": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero tax rates",
                "description": "Lists Xero tax rates, optionally filtered by tax type.",
                "operationId": "14b94ca48a26df7c1d07fb3e586b0a8b",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Tax rate type filter",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tax rates retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve tax rates"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/tax-rates/output": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero output tax rates",
                "description": "Lists Xero output tax rates (commonly used for sales invoices).",
                "operationId": "d323cfcf3adc731f98d3b7a3389ffca2",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Output tax rates retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve output tax rates"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/tax-rates/input": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero input tax rates",
                "description": "Lists Xero input tax rates (commonly used for purchase invoices).",
                "operationId": "5b8294fb8864de891d5fa92c65cf94e2",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Input tax rates retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve input tax rates"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/currencies": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "List Xero currencies",
                "description": "Lists currencies available in the connected Xero organization.",
                "operationId": "9a877f6d8fd6696deebaa1e337fc48f2",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Currencies retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to retrieve currencies"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/invoices/{invoiceId}": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get a single Xero invoice",
                "description": "Retrieves a single Xero invoice by ID, formatted for edit forms.",
                "operationId": "53ef041b052cc63c413848d2196a0246",
                "parameters": [
                    {
                        "name": "invoiceId",
                        "in": "path",
                        "description": "Xero invoice UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "401": {
                        "description": "Authentication expired - please re-authenticate"
                    },
                    "500": {
                        "description": "Failed to retrieve invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Update a Xero invoice",
                "description": "Updates an existing Xero invoice. Uses the same field validation as Create Invoice.",
                "operationId": "2a48ccef3bd88ed586e3a43862abc759",
                "parameters": [
                    {
                        "name": "invoiceId",
                        "in": "path",
                        "description": "Xero invoice UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "description": "Xero contact UUID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Invoice type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ACCREC",
                                "ACCPAY"
                            ]
                        }
                    },
                    {
                        "name": "invoice_number",
                        "in": "query",
                        "description": "Invoice number",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Invoice reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "issue_date",
                        "in": "query",
                        "description": "Issue date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Due date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "currency_code",
                        "in": "query",
                        "description": "3-letter currency code",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 3,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Invoice status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "DRAFT",
                                "SUBMITTED",
                                "AUTHORISED",
                                "PAID",
                                "VOIDED"
                            ]
                        }
                    },
                    {
                        "name": "line_items",
                        "in": "query",
                        "description": "Array of invoice line items",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Invoice updated successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "422": {
                        "description": "Invoice cannot be updated in its current status"
                    },
                    "500": {
                        "description": "Failed to update invoice"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/{billId}": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get a single Xero bill",
                "description": "Retrieves a single Xero bill (purchase invoice) by its UUID.",
                "operationId": "48a07f732124237cfa92472d3a544c2f",
                "parameters": [
                    {
                        "name": "billId",
                        "in": "path",
                        "description": "Xero bill UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bill retrieved successfully"
                    },
                    "400": {
                        "description": "Invalid bill ID format or not a bill"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "403": {
                        "description": "Access denied"
                    },
                    "404": {
                        "description": "Bill or Xero connection not found"
                    },
                    "500": {
                        "description": "Failed to retrieve bill details"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Update a Xero bill",
                "description": "Updates an existing Xero bill.",
                "operationId": "d8fb152a1fc27ca36987600c6e2deaaa",
                "parameters": [
                    {
                        "name": "billId",
                        "in": "path",
                        "description": "Xero bill UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Bill reference",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Bill date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "due_date",
                        "in": "query",
                        "description": "Bill due date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Bill status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "currency_code",
                        "in": "query",
                        "description": "3-letter currency code",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 3,
                            "minLength": 3
                        }
                    },
                    {
                        "name": "line_items",
                        "in": "query",
                        "description": "Array of bill line items",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bill updated successfully"
                    },
                    "400": {
                        "description": "Update failed"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "Bill or Xero connection not found"
                    },
                    "422": {
                        "description": "Bill cannot be updated in its current status"
                    },
                    "500": {
                        "description": "Failed to update bill"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/bills/{billId}/notes": {
            "post": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Add a note or attachment to a Xero bill",
                "description": "Adds a reference note or file attachment to an existing Xero bill.",
                "operationId": "c7fd375e9c4dbdf86da2c348d1000653",
                "parameters": [
                    {
                        "name": "billId",
                        "in": "path",
                        "description": "Xero bill UUID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for multi-tenant applications",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Note type",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "reference",
                                "attachment"
                            ]
                        }
                    },
                    {
                        "name": "content",
                        "in": "query",
                        "description": "Reference text content (required when type=reference)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "filename",
                        "in": "query",
                        "description": "Attachment filename (required when type=attachment)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file_contents",
                        "in": "query",
                        "description": "Base64-encoded file contents (required when type=attachment)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Note added successfully"
                    },
                    "400": {
                        "description": "Invalid bill ID format or failed to add note"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "No Xero connection found"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Failed to add note"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/balance-sheet": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Xero Balance Sheet report",
                "description": "Retrieves a Balance Sheet report from Xero with flexible comparison options.",
                "operationId": "483b29a60882eef56dc9e62d8fcb4602",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "Report date (YYYY-MM-DD). Defaults to today.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code (max 3 characters, default INR)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "INR",
                            "maxLength": 3
                        }
                    },
                    {
                        "name": "comparison_type",
                        "in": "query",
                        "description": "Comparison period type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "None",
                            "enum": [
                                "None",
                                "1_quarter",
                                "2_quarters",
                                "3_quarters",
                                "4_quarters",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "comparison_period_type",
                        "in": "query",
                        "description": "Custom comparison period type",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "Day",
                                "Month",
                                "Quarter",
                                "Year"
                            ]
                        }
                    },
                    {
                        "name": "comparison_period_count",
                        "in": "query",
                        "description": "Custom comparison period count (1-10)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 10,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "custom_comparison_date",
                        "in": "query",
                        "description": "Custom comparison date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "tracking_option_id_1",
                        "in": "query",
                        "description": "First tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tracking_option_id_2",
                        "in": "query",
                        "description": "Second tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "standard_layout",
                        "in": "query",
                        "description": "Use Xero's standard layout",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    },
                    {
                        "name": "payments_only",
                        "in": "query",
                        "description": "Return cash-basis balance sheet (payments only)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Balance sheet report retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed or invalid comparison date"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "Xero connection not found"
                    },
                    "500": {
                        "description": "Failed to retrieve balance sheet report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/balance-sheet-comparison": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Balance Sheet comparison report",
                "description": "Retrieves a Balance Sheet report comparing two custom dates and calculates variance.",
                "operationId": "d7795c7b541fe1fd86f01187a3999d99",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "current_date",
                        "in": "query",
                        "description": "Current period date (YYYY-MM-DD)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "comparison_date",
                        "in": "query",
                        "description": "Comparison period date (YYYY-MM-DD), must be before current_date",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "currency",
                        "in": "query",
                        "description": "Currency code (max 3 characters, default INR)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "INR",
                            "maxLength": 3
                        }
                    },
                    {
                        "name": "tracking_option_id_1",
                        "in": "query",
                        "description": "First tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tracking_option_id_2",
                        "in": "query",
                        "description": "Second tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "standard_layout",
                        "in": "query",
                        "description": "Use Xero's standard layout",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    },
                    {
                        "name": "payments_only",
                        "in": "query",
                        "description": "Return cash-basis balance sheet",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Balance sheet comparison report retrieved successfully"
                    },
                    "400": {
                        "description": "Validation failed"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "Xero connection not found"
                    },
                    "500": {
                        "description": "Failed to retrieve balance sheet comparison report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/balance-sheet-comparison-options": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Balance Sheet comparison options",
                "description": "Returns the list of available comparison types and period types that can be used with the Balance Sheet report.",
                "operationId": "5fb818202a832ade6957752ce1c26e6c",
                "responses": {
                    "200": {
                        "description": "Balance sheet comparison options retrieved successfully"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/xero/reports/profit-and-loss": {
            "get": {
                "tags": [
                    "Xero Reports"
                ],
                "summary": "Get Profit and Loss report",
                "description": "Retrieves a Profit and Loss report from Xero with optional comparison and filter options.",
                "operationId": "fe50dc896d47114a0ae4e3e75621827d",
                "parameters": [
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID for Xero connection",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "options_only",
                        "in": "query",
                        "description": "If true, return only the filter options without running the report",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "date_range",
                        "in": "query",
                        "description": "Predefined date range",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "this_month",
                                "this_quarter",
                                "this_financial_year",
                                "last_month",
                                "last_quarter",
                                "last_financial_year",
                                "month_to_date",
                                "quarter_to_date",
                                "year_to_date",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "from_date",
                        "in": "query",
                        "description": "Custom from date (YYYY-MM-DD), used when date_range=custom",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to_date",
                        "in": "query",
                        "description": "Custom to date (YYYY-MM-DD), used when date_range=custom",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "compare_with",
                        "in": "query",
                        "description": "Comparison mode",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "None",
                                "previous_period",
                                "previous_year",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "comparison_from_date",
                        "in": "query",
                        "description": "Custom comparison from date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "comparison_to_date",
                        "in": "query",
                        "description": "Custom comparison to date (YYYY-MM-DD)",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "periods",
                        "in": "query",
                        "description": "Number of periods to include (1-12)",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 12,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "tracking_category_id",
                        "in": "query",
                        "description": "First tracking category ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tracking_category_id2",
                        "in": "query",
                        "description": "Second tracking category ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tracking_option_id",
                        "in": "query",
                        "description": "First tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tracking_option_id2",
                        "in": "query",
                        "description": "Second tracking option ID",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "standard_layout",
                        "in": "query",
                        "description": "Use Xero's standard layout",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    },
                    {
                        "name": "payments_only",
                        "in": "query",
                        "description": "Return cash-basis Profit and Loss (payments only)",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Profit and Loss report retrieved successfully"
                    },
                    "401": {
                        "description": "User not authenticated"
                    },
                    "404": {
                        "description": "Xero connection not found"
                    },
                    "422": {
                        "description": "Invalid parameters"
                    },
                    "500": {
                        "description": "Failed to retrieve Profit and Loss report"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/addXeroKeys": {
            "post": {
                "tags": [
                    "Xero Integration"
                ],
                "summary": "Add Xero integration keys for a client",
                "operationId": "3bcf6a49e2978d7bb8eeac030f479431",
                "parameters": [
                    {
                        "name": "xero_client_id",
                        "in": "query",
                        "description": "Xero client ID",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "xero_client_secret_key",
                        "in": "query",
                        "description": "Xero client secret key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_id",
                        "in": "query",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero keys added successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Xero Keys has been added successfully."
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/getXeroKeys/{id}": {
            "get": {
                "tags": [
                    "Xero Integration"
                ],
                "summary": "Get Xero integration keys for a client",
                "operationId": "506fd2ea96517e956f4f29eac5fc28dd",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero keys retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Xero keys not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/deleteXeroKeys/{id}": {
            "post": {
                "tags": [
                    "Xero Integration"
                ],
                "summary": "Delete Xero integration keys for a client",
                "operationId": "dd6b541bb9e5becba14a009b534c49ce",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Client ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Xero keys deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Xero keys not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/hooks": {
            "post": {
                "tags": [
                    "Zapier Webhooks"
                ],
                "summary": "Subscribe a user to a Zapier webhook",
                "operationId": "aea301bc1f9b84e6b0f833db00530c85",
                "parameters": [
                    {
                        "name": "zap_id",
                        "in": "query",
                        "description": "ID of the Zapier webhook",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "12345"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User's email address",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "email",
                            "example": "user@example.com"
                        }
                    },
                    {
                        "name": "hookUrl",
                        "in": "query",
                        "description": "URL of the webhook",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "url",
                            "example": "https://example.com/webhook"
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Event name for the webhook subscription",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "order.created"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook subscription created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "id": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string",
                                            "format": "email"
                                        },
                                        "url": {
                                            "type": "string",
                                            "format": "url"
                                        },
                                        "client_id": {
                                            "type": "integer"
                                        },
                                        "event": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid input"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/hooks/{id}": {
            "delete": {
                "tags": [
                    "Zapier Webhooks"
                ],
                "summary": "Delete a Zapier Webhook",
                "operationId": "8f0137ef4ccf60657196a61769ad393d",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of the Zapier webhook to delete",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Webhook deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "string",
                                            "example": "success"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Webhook not found"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/api/polling/trigger": {
            "get": {
                "tags": [
                    "Zapier"
                ],
                "summary": "Poll for Zapier trigger data",
                "operationId": "23b5391dbb0759263d79ecbb7956a9e9",
                "responses": {
                    "200": {
                        "description": "Returns an array of trigger data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "id": {
                                                "type": "integer",
                                                "example": 12345
                                            },
                                            "annual_revenue": {
                                                "type": "integer",
                                                "example": 100
                                            },
                                            "city": {
                                                "type": "string",
                                                "example": "Surat"
                                            },
                                            "company_email": {
                                                "type": "string",
                                                "example": "test1@telsamedia.com"
                                            },
                                            "company_name": {
                                                "type": "string",
                                                "example": "Telagus"
                                            },
                                            "company_service": {
                                                "type": "string",
                                                "example": "Digital Marketing"
                                            },
                                            "company_website": {
                                                "type": "string",
                                                "example": "https://www.telagus.com"
                                            },
                                            "country": {
                                                "type": "string",
                                                "example": "India"
                                            },
                                            "email": {
                                                "type": "string",
                                                "example": "test1@telsamedia.com"
                                            },
                                            "first_name": {
                                                "type": "string",
                                                "example": "John"
                                            },
                                            "gender": {
                                                "type": "string",
                                                "example": "Deo"
                                            },
                                            "job_title": {
                                                "type": "string",
                                                "example": "Admin"
                                            },
                                            "locality": {
                                                "type": "string",
                                                "example": "India"
                                            },
                                            "mobile_number": {
                                                "type": "string",
                                                "example": "1234567890"
                                            },
                                            "number_of_employees": {
                                                "type": "string",
                                                "example": "35"
                                            },
                                            "phone_number": {
                                                "type": "string",
                                                "example": "123456"
                                            },
                                            "postcode": {
                                                "type": "string",
                                                "example": "395006"
                                            },
                                            "state": {
                                                "type": "string",
                                                "example": "Gujarat"
                                            },
                                            "street_address": {
                                                "type": "string",
                                                "example": "Proton Plus"
                                            },
                                            "street_address2": {
                                                "type": "string",
                                                "example": "Adajan"
                                            },
                                            "last_name": {
                                                "type": "string",
                                                "example": "Deo"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Zapier Hooks"
                ],
                "summary": "Zapier polling endpoint — returns the last 5 leads for a user's client",
                "description": "Resolves the client by the supplied `email`, then returns the 5 most recent leads for that client with embedded contacts (and the first contact's address).",
                "operationId": "zapierPollForTrigger",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "description": "A user email belonging to the target client",
                                        "type": "string",
                                        "format": "email",
                                        "example": "ops@example.com"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Last-5-leads slice",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unknown email or server error"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AiCadenceSetupSessionPayload": {
                "description": "Live progress of a voice-guided AI cadence setup session. The conversation review fields (collected_display, transcript, recording_url, recording_duration) are only present while the setup is incomplete — completed sessions omit them.",
                "properties": {
                    "session_id": {
                        "type": "integer",
                        "example": 12
                    },
                    "status": {
                        "type": "string",
                        "example": "pending_review",
                        "enum": [
                            "calling",
                            "in_progress",
                            "abandoned",
                            "failed",
                            "pending_review",
                            "completed",
                            "discarded"
                        ]
                    },
                    "current_step": {
                        "type": "string",
                        "nullable": true
                    },
                    "current_field": {
                        "type": "string",
                        "nullable": true
                    },
                    "answers_collected": {
                        "description": "Number of interview answers collected so far",
                        "type": "integer",
                        "example": 7
                    },
                    "collected_data": {
                        "description": "Raw collected answers keyed by field",
                        "type": "object"
                    },
                    "ai_cadence_setting_id": {
                        "description": "Set once the AI agent has been created from this session",
                        "type": "integer",
                        "nullable": true
                    },
                    "ai_user_id": {
                        "description": "User id of the created AI agent",
                        "type": "integer",
                        "nullable": true
                    },
                    "collected_display": {
                        "description": "Human-readable collected values (account labels instead of internal ids); incomplete sessions only",
                        "type": "object",
                        "nullable": true
                    },
                    "transcript": {
                        "description": "Interview chat transcript; incomplete sessions only",
                        "type": "array",
                        "items": {
                            "properties": {
                                "role": {
                                    "type": "string",
                                    "enum": [
                                        "assistant",
                                        "user"
                                    ]
                                },
                                "message": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "nullable": true
                    },
                    "recording_url": {
                        "description": "Twilio media URL of the setup call recording, when one exists; incomplete sessions only",
                        "type": "string",
                        "nullable": true
                    },
                    "recording_duration": {
                        "description": "Recording length in seconds (the streamed media exposes no length to the browser player)",
                        "type": "integer",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "AiCadenceSetupError": {
                "description": "Error shape used by the setup-call endpoints. All errors (including not-found) use the configured ERROR_CODE HTTP status (422). Validation failures carry `errors` instead of `message`.",
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string",
                        "nullable": true
                    },
                    "errors": {
                        "description": "Field => messages map, present on validation failures",
                        "type": "object",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "AttendanceReportRow": {
                "description": "One row per user per work date (client timezone). Sessions with a missing out_time are excluded; a session spanning 24h+ is capped at the user's duty hours. Duty hours default to 9 when the user has none set.",
                "properties": {
                    "user": {
                        "description": "User id",
                        "type": "integer"
                    },
                    "user_name": {
                        "type": "string"
                    },
                    "work_date": {
                        "type": "string",
                        "format": "date"
                    },
                    "total_sessions": {
                        "type": "integer"
                    },
                    "total_hours": {
                        "description": "Worked time as H:i",
                        "type": "string",
                        "example": "08:45"
                    },
                    "expected_hours": {
                        "description": "Duty hours as H:i",
                        "type": "string",
                        "example": "09:00"
                    },
                    "plus_minus_hours": {
                        "description": "Signed difference vs duty as H:i",
                        "type": "string",
                        "example": "-00:15"
                    },
                    "cumulative_deficit_userwise": {
                        "description": "Per-user running deficit across the period as signed H:i",
                        "type": "string",
                        "example": "-01:30"
                    }
                },
                "type": "object"
            },
            "AuthenticatedLoginPayload": {
                "description": "The standard authenticated login payload, returned by /api/login on success and by /api/verify-login-otp once the OTP is verified.",
                "properties": {
                    "error": {
                        "type": "boolean",
                        "example": false
                    },
                    "user": {
                        "description": "User data (with lead position)",
                        "type": "object"
                    },
                    "user_info": {
                        "description": "Profile and address info with role and permissions",
                        "type": "object"
                    },
                    "team_id": {
                        "description": "Permissions team id (the user's client id)",
                        "type": "integer"
                    },
                    "xero_info": {
                        "description": "Xero client data",
                        "type": "object"
                    },
                    "access_token": {
                        "description": "OAuth access token",
                        "type": "string"
                    },
                    "columns_grid_of_custom_fields_info": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "columns_grid_of_leads_info": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "choose_module_info": {
                        "description": "Module access settings",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "CallReportFilters": {
                "description": "Shared filter payload accepted by every Call Reports endpoint. All fields are optional; omitting the dates means all time. Dates are interpreted in the client's timezone and converted to UTC server-side. Results are always scoped to the authenticated user's client, and users holding \"Own Call Logs\" without \"All Call Logs\" only ever see their own calls.",
                "properties": {
                    "start_date": {
                        "description": "Period start date (client timezone)",
                        "type": "string",
                        "format": "date",
                        "example": "2026-08-01",
                        "nullable": true
                    },
                    "end_date": {
                        "description": "Period end date (client timezone); may include a time component",
                        "type": "string",
                        "example": "2026-08-25 23:59:59",
                        "nullable": true
                    },
                    "assigned_to": {
                        "description": "Restrict to these salesperson user ids (a single id is also accepted)",
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "example": 42
                        },
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "CallReportAggregates": {
                "description": "One-pass outbound call aggregates for a period. A call counts as connected when its Twilio status is `completed`; busy / no-answer / failed / canceled make up the not-connected set.",
                "properties": {
                    "total_calls": {
                        "type": "integer",
                        "example": 250
                    },
                    "connected_calls": {
                        "type": "integer",
                        "example": 120
                    },
                    "answer_rate": {
                        "description": "connected_calls / total_calls as a percentage",
                        "type": "number",
                        "format": "float",
                        "example": 48
                    },
                    "not_connected": {
                        "properties": {
                            "busy": {
                                "type": "integer"
                            },
                            "no_answer": {
                                "type": "integer"
                            },
                            "failed": {
                                "type": "integer"
                            },
                            "canceled": {
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    },
                    "talk_time_seconds": {
                        "description": "Total duration of connected calls, in seconds",
                        "type": "integer",
                        "example": 18600
                    },
                    "avg_duration_seconds": {
                        "description": "talk_time_seconds / connected_calls",
                        "type": "integer",
                        "example": 155
                    },
                    "leads_called": {
                        "description": "Distinct leads dialled",
                        "type": "integer",
                        "example": 180
                    }
                },
                "type": "object"
            },
            "CallReportError": {
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ChatWidgetSendMessagePayload": {
                "description": "Message sent by an anonymous website visitor through the embedded chat widget. Use multipart/form-data when attaching files; message_content may be omitted only when a file is sent.",
                "required": [
                    "person_random_id",
                    "conversation_identifier",
                    "application_id"
                ],
                "properties": {
                    "person_random_id": {
                        "description": "Random id identifying the visitor across messages",
                        "type": "string",
                        "example": "p_8f3a2c1d"
                    },
                    "conversation_identifier": {
                        "description": "Identifier of the conversation this message belongs to",
                        "type": "string",
                        "example": "c_5e9b7a42"
                    },
                    "application_id": {
                        "description": "Client id of the widget owner (the legacy tmApplicationId)",
                        "type": "integer",
                        "example": 1
                    },
                    "chat_widget_id": {
                        "description": "Widget the conversation came from; legacy pages without it fall back to the client's first widget",
                        "type": "integer",
                        "nullable": true
                    },
                    "message_content": {
                        "description": "Message text; required unless a file is attached",
                        "type": "string",
                        "example": "Hi, do you ship to Ireland?",
                        "nullable": true
                    },
                    "request_support": {
                        "description": "True when the visitor asked for human support",
                        "type": "boolean",
                        "example": false,
                        "nullable": true
                    },
                    "file": {
                        "description": "Attachments, each max 10 MB (multipart only)",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "binary"
                        },
                        "nullable": true
                    },
                    "email": {
                        "description": "Visitor email, stored on the person when provided",
                        "type": "string",
                        "format": "email",
                        "nullable": true
                    },
                    "full_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "phone_number": {
                        "type": "string",
                        "nullable": true
                    },
                    "response": {
                        "description": "Visitor's answer to a widget pre-chat question",
                        "type": "string",
                        "nullable": true
                    },
                    "os_name": {
                        "description": "Visitor OS name (telemetry)",
                        "type": "string",
                        "example": "Windows",
                        "nullable": true
                    },
                    "browserName": {
                        "description": "Visitor browser name (telemetry; also stored as the message's sent_from_device)",
                        "type": "string",
                        "example": "Chrome",
                        "nullable": true
                    },
                    "fullVersion": {
                        "description": "Browser version (telemetry)",
                        "type": "string",
                        "nullable": true
                    },
                    "request_from_url": {
                        "description": "URL of the page the message was sent from",
                        "type": "string",
                        "format": "url",
                        "nullable": true
                    },
                    "page_title": {
                        "description": "Title of that page",
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ChatWidget": {
                "description": "A chat widget (Chatsettings row). Note assigned_to is a JSON-encoded string of user ids (e.g. \"[1,2]\"), not an array, and the boolean flags are stored as 0/1 integers.",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 5
                    },
                    "client_id": {
                        "type": "integer",
                        "example": 1
                    },
                    "name": {
                        "description": "Internal widget name shown in the dashboard list",
                        "type": "string",
                        "example": "Main website"
                    },
                    "widget_key": {
                        "description": "UUID used by embeds to address this widget; generated on create",
                        "type": "string",
                        "format": "uuid"
                    },
                    "title": {
                        "description": "Header title shown to visitors",
                        "type": "string",
                        "example": "Hello!"
                    },
                    "subtitle": {
                        "type": "string",
                        "nullable": true
                    },
                    "greeting_message": {
                        "type": "string",
                        "nullable": true,
                        "maxLength": 500
                    },
                    "prompt_suggestions": {
                        "description": "Suggestion chips shown to visitors (max 4)",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "maxLength": 120
                        },
                        "nullable": true
                    },
                    "launcher_position": {
                        "type": "string",
                        "nullable": true,
                        "enum": [
                            "left",
                            "right"
                        ]
                    },
                    "background_color": {
                        "type": "string",
                        "example": "#b743ae",
                        "nullable": true
                    },
                    "chat_icon": {
                        "type": "string",
                        "example": "fas fa-comment-dots",
                        "nullable": true
                    },
                    "assigned_to": {
                        "description": "JSON-encoded array of assigned user ids; conversation listings and human-handoff notifications only reach assigned users",
                        "type": "string",
                        "example": "[42]",
                        "nullable": true
                    },
                    "chat_on_off": {
                        "description": "1 = widget enabled",
                        "type": "integer",
                        "enum": [
                            0,
                            1
                        ]
                    },
                    "is_ai_response_enabled": {
                        "description": "1 = AI auto-replies enabled",
                        "type": "integer",
                        "enum": [
                            0,
                            1
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "IncomingLeadPayload": {
                "description": "Payload accepted by POST /api/webhooks/{webhook}/lead. Validation rules live in IncomingLeadsRequest.",
                "required": [
                    "lead"
                ],
                "properties": {
                    "lead": {
                        "required": [
                            "lead_source"
                        ],
                        "properties": {
                            "lead_source": {
                                "type": "string",
                                "example": "Website",
                                "maxLength": 255
                            },
                            "ip": {
                                "type": "string",
                                "format": "ipv4",
                                "example": "192.168.1.1",
                                "nullable": true
                            },
                            "price": {
                                "type": "number",
                                "format": "float",
                                "example": 1000.5,
                                "nullable": true
                            },
                            "lead_position_id": {
                                "description": "Array of lead position names (resolved server-side)",
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "example": "New Lead"
                                },
                                "nullable": true
                            },
                            "message": {
                                "type": "string",
                                "example": "Interested in your services.",
                                "nullable": true
                            },
                            "lead_title": {
                                "type": "string",
                                "example": "New website enquiry",
                                "nullable": true,
                                "maxLength": 191
                            },
                            "domain": {
                                "type": "string",
                                "example": "example.com",
                                "nullable": true,
                                "maxLength": 191
                            },
                            "close_date": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-06-15 14:30:00",
                                "nullable": true
                            },
                            "currency": {
                                "type": "string",
                                "example": "GBP",
                                "nullable": true,
                                "maxLength": 191
                            },
                            "form": {
                                "type": "string",
                                "example": "Contact Form",
                                "nullable": true
                            },
                            "form_page": {
                                "type": "string",
                                "example": "/contact-us",
                                "nullable": true,
                                "maxLength": 191
                            },
                            "linkedin_url": {
                                "type": "string",
                                "example": "https://www.linkedin.com/in/john-doe",
                                "nullable": true,
                                "maxLength": 150
                            },
                            "facebook_url": {
                                "type": "string",
                                "example": "https://www.facebook.com/john.doe",
                                "nullable": true,
                                "maxLength": 150
                            },
                            "ecommerce_created_at": {
                                "type": "string",
                                "format": "date-time",
                                "nullable": true
                            },
                            "ecommerce_customer_id": {
                                "type": "integer",
                                "example": 1001,
                                "nullable": true
                            },
                            "ecommerce_order_id": {
                                "type": "integer",
                                "example": 5001,
                                "nullable": true
                            },
                            "ecommerce_id": {
                                "type": "integer",
                                "example": 1,
                                "nullable": true
                            }
                        },
                        "type": "object"
                    },
                    "contacts": {
                        "type": "array",
                        "items": {
                            "required": [
                                "first_name",
                                "last_name",
                                "email",
                                "is_primary_contact"
                            ],
                            "properties": {
                                "first_name": {
                                    "type": "string",
                                    "example": "John",
                                    "maxLength": 255
                                },
                                "last_name": {
                                    "type": "string",
                                    "example": "Doe",
                                    "maxLength": 255
                                },
                                "email": {
                                    "type": "string",
                                    "format": "email",
                                    "example": "john@example.com"
                                },
                                "is_primary_contact": {
                                    "type": "boolean",
                                    "example": true
                                },
                                "phone_number": {
                                    "type": "string",
                                    "example": "1234567890",
                                    "nullable": true,
                                    "maxLength": 50
                                },
                                "job_title": {
                                    "type": "string",
                                    "example": "Manager",
                                    "nullable": true,
                                    "maxLength": 255
                                }
                            },
                            "type": "object"
                        },
                        "nullable": true
                    },
                    "company": {
                        "required": [
                            "company_name"
                        ],
                        "properties": {
                            "company_name": {
                                "type": "string",
                                "example": "Example Corp",
                                "maxLength": 255
                            },
                            "company_service": {
                                "type": "string",
                                "example": "IT Solutions",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "company_website": {
                                "type": "string",
                                "format": "url",
                                "example": "https://example.com",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "company_email": {
                                "type": "string",
                                "format": "email",
                                "example": "info@example.com",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "phone_number": {
                                "type": "string",
                                "example": "1234567890",
                                "nullable": true,
                                "maxLength": 50
                            },
                            "street_address": {
                                "type": "string",
                                "example": "123 Main St",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "street_address2": {
                                "type": "string",
                                "example": "Suite 200",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "city": {
                                "type": "string",
                                "example": "New York",
                                "nullable": true,
                                "maxLength": 100
                            },
                            "state": {
                                "type": "string",
                                "example": "NY",
                                "nullable": true,
                                "maxLength": 100
                            },
                            "country": {
                                "type": "string",
                                "example": "USA",
                                "nullable": true,
                                "maxLength": 100
                            },
                            "postcode": {
                                "type": "string",
                                "example": "10001",
                                "nullable": true,
                                "maxLength": 20
                            },
                            "state_county_provices_region": {
                                "type": "string",
                                "example": "New York County",
                                "nullable": true,
                                "maxLength": 255
                            },
                            "year_founded": {
                                "type": "integer",
                                "example": 2005,
                                "nullable": true
                            },
                            "is_primary_company": {
                                "type": "boolean",
                                "example": true,
                                "nullable": true
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "custom_fields": {
                        "description": "Key/value map. Keys must match the client's CustomFields titles; each value is a string (max 1000 chars).",
                        "type": "object",
                        "example": {
                            "Industry": "Retail",
                            "Source Detail": "Trade show 2025"
                        },
                        "nullable": true,
                        "additionalProperties": {
                            "type": "string",
                            "maxLength": 1000
                        }
                    }
                },
                "type": "object"
            },
            "OutgoingWebhookHeader": {
                "description": "Single HTTP header entry sent with the outgoing webhook. Entries missing `key` or `value` are filtered out by the controller.",
                "required": [
                    "key",
                    "value"
                ],
                "properties": {
                    "key": {
                        "type": "string",
                        "example": "Authorization"
                    },
                    "value": {
                        "type": "string",
                        "example": "Bearer abc123"
                    }
                },
                "type": "object"
            },
            "OutgoingWebhookPayload": {
                "description": "Payload for creating or updating an OutgoingWebhook. The controller also accepts snake_case `body_type` and a generic `body` field which it normalises to the camelCase variants below before validation.",
                "required": [
                    "url",
                    "webhook_method",
                    "event",
                    "bodyType"
                ],
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "url",
                        "example": "https://hooks.example.com/lead-created"
                    },
                    "webhook_method": {
                        "description": "HTTP method to use when firing the webhook",
                        "type": "string",
                        "example": "POST"
                    },
                    "event": {
                        "description": "Event name that triggers this webhook (e.g. lead.created)",
                        "type": "string",
                        "example": "lead.created"
                    },
                    "bodyType": {
                        "type": "string",
                        "example": "formData",
                        "enum": [
                            "formData",
                            "raw"
                        ]
                    },
                    "bodyFormData": {
                        "description": "Required when bodyType=formData. Free-form list of key/value entries; persisted verbatim.",
                        "type": "array",
                        "items": {
                            "properties": {
                                "key": {
                                    "type": "string",
                                    "example": "email"
                                },
                                "value": {
                                    "type": "string",
                                    "example": "{{lead.email}}"
                                }
                            },
                            "type": "object"
                        },
                        "nullable": true
                    },
                    "bodyRaw": {
                        "description": "Required when bodyType=raw. Stored as {\"raw\": <string>}.",
                        "type": "string",
                        "example": "{\"email\":\"{{lead.email}}\"}",
                        "nullable": true
                    },
                    "headers": {
                        "description": "May also be supplied as a JSON-encoded string — controller decodes it before validation.",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OutgoingWebhookHeader"
                        },
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "DashboardGridItem": {
                "title": "Dashboard Grid Item",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "widget-1"
                    },
                    "x": {
                        "type": "integer",
                        "example": 0
                    },
                    "y": {
                        "type": "integer",
                        "example": 0
                    },
                    "w": {
                        "type": "integer",
                        "example": 6
                    },
                    "h": {
                        "type": "integer",
                        "example": 4
                    }
                },
                "type": "object"
            },
            "EstimateAttachment": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "file": {
                        "type": "string"
                    },
                    "client_id": {
                        "type": "integer"
                    },
                    "user_id": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "QuoteSettings": {
                "description": "Quote-only display settings, edited from the \"Quote Settings\" side modal on a quote. Missing keys fall back to the defaults (show_logo_footer_on_all_pages: false, show_quote_parties: true) so clients that never opened the modal behave as before.",
                "properties": {
                    "show_logo_footer_on_all_pages": {
                        "description": "Repeat the logo/footer on every PDF page instead of only the first/last",
                        "type": "boolean",
                        "example": false
                    },
                    "show_quote_parties": {
                        "description": "Show the from/to parties block on the quote",
                        "type": "boolean",
                        "example": true
                    }
                },
                "type": "object"
            },
            "AccountHierarchyNode": {
                "required": [
                    "id",
                    "name"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "1234567890"
                    },
                    "name": {
                        "type": "string",
                        "example": "Sample Account"
                    },
                    "level": {
                        "type": "integer",
                        "example": 0
                    },
                    "is_manager": {
                        "type": "boolean",
                        "example": true
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/AccountHierarchyNode"
                        }
                    }
                },
                "type": "object"
            },
            "LeadUploadLinkPayload": {
                "description": "A shareable guest upload link for a lead. A link is active while it is not revoked and not past its expiry.",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 7
                    },
                    "token": {
                        "description": "Opaque token identifying the link in the public endpoints",
                        "type": "string",
                        "example": "aBcDeFgH1234..."
                    },
                    "url": {
                        "description": "Full frontend URL to hand to the guest (ANGULAR_URI/lead-upload/{token})",
                        "type": "string",
                        "format": "url",
                        "example": "https://app.telagus.com/lead-upload/aBcDeFgH1234"
                    },
                    "expires_at": {
                        "description": "Expiry timestamp; null means the link does not expire",
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ProjectAttachment": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "file_name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "project_id": {
                        "type": "integer"
                    },
                    "file_size": {
                        "type": "number"
                    },
                    "uploaded_by": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "deleted_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "AI Chatbot",
            "description": "API Endpoints for AI Chatbot functionality"
        },
        {
            "name": "Campaign Reports",
            "description": "API endpoints for campaign and analytics reporting"
        },
        {
            "name": "Chat Settings",
            "description": "API Endpoints for Chat Settings"
        },
        {
            "name": "Contract Items",
            "description": "API Endpoints for Contract Items"
        },
        {
            "name": "Email Template Category",
            "description": "API Endpoints for Email Template Categories"
        },
        {
            "name": "Estimate Attachments",
            "description": "API Endpoints for Estimate Attachment List Management"
        },
        {
            "name": "Estimate Items",
            "description": "API Endpoints for managing estimate items"
        },
        {
            "name": "Instagram",
            "description": "API Endpoints for Instagram integration"
        },
        {
            "name": "Items",
            "description": "API Endpoints for Items Management"
        },
        {
            "name": "Lead Action Plans",
            "description": "API endpoints for managing lead action plans"
        },
        {
            "name": "Lead App",
            "description": "API Endpoints for Lead App operations"
        },
        {
            "name": "Lead Position Stage",
            "description": "API Endpoints for Lead Position Stage management"
        },
        {
            "name": "Project Files",
            "description": "API Endpoints for Project Files Management"
        },
        {
            "name": "Project Sub Tasks",
            "description": "API endpoints for managing project sub-tasks and timings"
        },
        {
            "name": "Restrictions",
            "description": "API Endpoints for managing feature restrictions and limits"
        },
        {
            "name": "SMS Tracking",
            "description": "API Endpoints for SMS Tracking"
        },
        {
            "name": "Subscription",
            "description": "API Endpoints for subscription management"
        },
        {
            "name": "Tax",
            "description": "API Endpoints for Tax Management"
        },
        {
            "name": "Tickets",
            "description": "API Endpoints for Ticket Management"
        },
        {
            "name": "Turnover Settings",
            "description": "API endpoints for managing turnover settings"
        },
        {
            "name": "Facebook Integration",
            "description": "Facebook Integration"
        },
        {
            "name": "Action Plan",
            "description": "Action Plan"
        },
        {
            "name": "Action Plan Campaign",
            "description": "Action Plan Campaign"
        },
        {
            "name": "Action Plan Types",
            "description": "Action Plan Types"
        },
        {
            "name": "Activities",
            "description": "Activities"
        },
        {
            "name": "Activity",
            "description": "Activity"
        },
        {
            "name": "Admin",
            "description": "Admin"
        },
        {
            "name": "AI Cadence Report",
            "description": "AI Cadence Report"
        },
        {
            "name": "AI Cadence Settings",
            "description": "AI Cadence Settings"
        },
        {
            "name": "AI Cadence Setup Call",
            "description": "AI Cadence Setup Call"
        },
        {
            "name": "AI Call",
            "description": "AI Call"
        },
        {
            "name": "AI Email Templates",
            "description": "AI Email Templates"
        },
        {
            "name": "AI Email Template",
            "description": "AI Email Template"
        },
        {
            "name": "AI Templates",
            "description": "AI Templates"
        },
        {
            "name": "AI Training",
            "description": "AI Training"
        },
        {
            "name": "Announcements",
            "description": "Announcements"
        },
        {
            "name": "Attendance",
            "description": "Attendance"
        },
        {
            "name": "Authentication",
            "description": "Authentication"
        },
        {
            "name": "Roles",
            "description": "Roles"
        },
        {
            "name": "Automation",
            "description": "Automation"
        },
        {
            "name": "AWS",
            "description": "AWS"
        },
        {
            "name": "AWS Email Verification",
            "description": "AWS Email Verification"
        },
        {
            "name": "AWS Hosting",
            "description": "AWS Hosting"
        },
        {
            "name": "Booking",
            "description": "Booking"
        },
        {
            "name": "Booking Form",
            "description": "Booking Form"
        },
        {
            "name": "Brand Kit",
            "description": "Brand Kit"
        },
        {
            "name": "Broadcasting",
            "description": "Broadcasting"
        },
        {
            "name": "Bundle",
            "description": "Bundle"
        },
        {
            "name": "Calendly",
            "description": "Calendly"
        },
        {
            "name": "Calendly Schedule",
            "description": "Calendly Schedule"
        },
        {
            "name": "Lead Calls",
            "description": "Lead Calls"
        },
        {
            "name": "Call Reports",
            "description": "Call Reports"
        },
        {
            "name": "Call Tracking",
            "description": "Call Tracking"
        },
        {
            "name": "Campaign Templates",
            "description": "Campaign Templates"
        },
        {
            "name": "Campaign",
            "description": "Campaign"
        },
        {
            "name": "Campaign Template",
            "description": "Campaign Template"
        },
        {
            "name": "Chat",
            "description": "Chat"
        },
        {
            "name": "Chat Person Details",
            "description": "Chat Person Details"
        },
        {
            "name": "Chat Widget",
            "description": "Chat Widget"
        },
        {
            "name": "Chatbot Credits",
            "description": "Chatbot Credits"
        },
        {
            "name": "Chat Widgets",
            "description": "Chat Widgets"
        },
        {
            "name": "Choose Module",
            "description": "Choose Module"
        },
        {
            "name": "Client",
            "description": "Client"
        },
        {
            "name": "Client Settings",
            "description": "Client Settings"
        },
        {
            "name": "Settings",
            "description": "Settings"
        },
        {
            "name": "ClientProduct",
            "description": "ClientProduct"
        },
        {
            "name": "Client Webhooks",
            "description": "Client Webhooks"
        },
        {
            "name": "Custom Fields",
            "description": "Custom Fields"
        },
        {
            "name": "Columns Grid",
            "description": "Columns Grid"
        },
        {
            "name": "Contact Types",
            "description": "Contact Types"
        },
        {
            "name": "Contract Attachments",
            "description": "Contract Attachments"
        },
        {
            "name": "Contract Attachment List",
            "description": "Contract Attachment List"
        },
        {
            "name": "Contracts",
            "description": "Contracts"
        },
        {
            "name": "Copilot",
            "description": "Copilot"
        },
        {
            "name": "Cron",
            "description": "Cron"
        },
        {
            "name": "Custom Field Values",
            "description": "Custom Field Values"
        },
        {
            "name": "Dashboard",
            "description": "Dashboard"
        },
        {
            "name": "Marketplace",
            "description": "Marketplace"
        },
        {
            "name": "Device Tokens",
            "description": "Device Tokens"
        },
        {
            "name": "Early Requests",
            "description": "Early Requests"
        },
        {
            "name": "Elevenlabs",
            "description": "Elevenlabs"
        },
        {
            "name": "Email Log",
            "description": "Email Log"
        },
        {
            "name": "Email Template Keywords",
            "description": "Email Template Keywords"
        },
        {
            "name": "Estimate Attachment",
            "description": "Estimate Attachment"
        },
        {
            "name": "Estimate Attachment List",
            "description": "Estimate Attachment List"
        },
        {
            "name": "Estimates",
            "description": "Estimates"
        },
        {
            "name": "Event Categories",
            "description": "Event Categories"
        },
        {
            "name": "Event",
            "description": "Event"
        },
        {
            "name": "Event Settings",
            "description": "Event Settings"
        },
        {
            "name": "Event Setting",
            "description": "Event Setting"
        },
        {
            "name": "Event Tags",
            "description": "Event Tags"
        },
        {
            "name": "Employee Feedback",
            "description": "Employee Feedback"
        },
        {
            "name": "Festival Leave",
            "description": "Festival Leave"
        },
        {
            "name": "Forms",
            "description": "Forms"
        },
        {
            "name": "Search",
            "description": "Search"
        },
        {
            "name": "Gmail",
            "description": "Gmail"
        },
        {
            "name": "Google Ads",
            "description": "Google Ads"
        },
        {
            "name": "Google Analytics",
            "description": "Google Analytics"
        },
        {
            "name": "Website Builder",
            "description": "Website Builder"
        },
        {
            "name": "Help Articles",
            "description": "Help Articles"
        },
        {
            "name": "Invoice",
            "description": "Invoice"
        },
        {
            "name": "Invoice Items",
            "description": "Invoice Items"
        },
        {
            "name": "Invoice Payments",
            "description": "Invoice Payments"
        },
        {
            "name": "Lead Appointments",
            "description": "Lead Appointments"
        },
        {
            "name": "Lead Company",
            "description": "Lead Company"
        },
        {
            "name": "Lead Contact",
            "description": "Lead Contact"
        },
        {
            "name": "Lead Custom Field Value",
            "description": "Lead Custom Field Value"
        },
        {
            "name": "Leads",
            "description": "Leads"
        },
        {
            "name": "Lead Inbox",
            "description": "Lead Inbox"
        },
        {
            "name": "Lead Fields Settings",
            "description": "Lead Fields Settings"
        },
        {
            "name": "Lead Files",
            "description": "Lead Files"
        },
        {
            "name": "Lead Filter Templates",
            "description": "Lead Filter Templates"
        },
        {
            "name": "Lead Positions",
            "description": "Lead Positions"
        },
        {
            "name": "Lead Position",
            "description": "Lead Position"
        },
        {
            "name": "Lead Position Stage Set",
            "description": "Lead Position Stage Set"
        },
        {
            "name": "Lead Reports",
            "description": "Lead Reports"
        },
        {
            "name": "Lead Score",
            "description": "Lead Score"
        },
        {
            "name": "Lead Source Settings",
            "description": "Lead Source Settings"
        },
        {
            "name": "Lead Tags",
            "description": "Lead Tags"
        },
        {
            "name": "Lead Task Comments",
            "description": "Lead Task Comments"
        },
        {
            "name": "Lead Task Comment",
            "description": "Lead Task Comment"
        },
        {
            "name": "Lead Tasks",
            "description": "Lead Tasks"
        },
        {
            "name": "Lead Task",
            "description": "Lead Task"
        },
        {
            "name": "Lead Upload Links",
            "description": "Lead Upload Links"
        },
        {
            "name": "Leaves",
            "description": "Leaves"
        },
        {
            "name": "Leave",
            "description": "Leave"
        },
        {
            "name": "Leave Types",
            "description": "Leave Types"
        },
        {
            "name": "Letters",
            "description": "Letters"
        },
        {
            "name": "Metered Billing Prices",
            "description": "Metered Billing Prices"
        },
        {
            "name": "Project Milestones",
            "description": "Project Milestones"
        },
        {
            "name": "Project Milestone",
            "description": "Project Milestone"
        },
        {
            "name": "MMS",
            "description": "MMS"
        },
        {
            "name": "Monthly Invoice",
            "description": "Monthly Invoice"
        },
        {
            "name": "Employee Settings",
            "description": "Employee Settings"
        },
        {
            "name": "Notes",
            "description": "Notes"
        },
        {
            "name": "Notifications",
            "description": "Notifications"
        },
        {
            "name": "Onboarding",
            "description": "Onboarding"
        },
        {
            "name": "Orders",
            "description": "Orders"
        },
        {
            "name": "Outlook",
            "description": "Outlook"
        },
        {
            "name": "Outlook Calendar Event",
            "description": "Outlook Calendar Event"
        },
        {
            "name": "Package Item Type",
            "description": "Package Item Type"
        },
        {
            "name": "Package Items List",
            "description": "Package Items List"
        },
        {
            "name": "Packages",
            "description": "Packages"
        },
        {
            "name": "Package Items",
            "description": "Package Items"
        },
        {
            "name": "Performance",
            "description": "Performance"
        },
        {
            "name": "Phone Numbers",
            "description": "Phone Numbers"
        },
        {
            "name": "PPC Reports",
            "description": "PPC Reports"
        },
        {
            "name": "Product",
            "description": "Product"
        },
        {
            "name": "Project Attachments",
            "description": "Project Attachments"
        },
        {
            "name": "Project Attachment",
            "description": "Project Attachment"
        },
        {
            "name": "Project Categories",
            "description": "Project Categories"
        },
        {
            "name": "Project Comments",
            "description": "Project Comments"
        },
        {
            "name": "Projects",
            "description": "Projects"
        },
        {
            "name": "Activity Logs",
            "description": "Activity Logs"
        },
        {
            "name": "Project Members",
            "description": "Project Members"
        },
        {
            "name": "Project Member",
            "description": "Project Member"
        },
        {
            "name": "Project Notes",
            "description": "Project Notes"
        },
        {
            "name": "Project Note",
            "description": "Project Note"
        },
        {
            "name": "Project Tasks",
            "description": "Project Tasks"
        },
        {
            "name": "QuickBooks Integration",
            "description": "QuickBooks Integration"
        },
        {
            "name": "Quickbooks Integration",
            "description": "Quickbooks Integration"
        },
        {
            "name": "Quote Template",
            "description": "Quote Template"
        },
        {
            "name": "Send Scheduled Campaign",
            "description": "Send Scheduled Campaign"
        },
        {
            "name": "SEO Reports",
            "description": "SEO Reports"
        },
        {
            "name": "Short URLs",
            "description": "Short URLs"
        },
        {
            "name": "Short URL",
            "description": "Short URL"
        },
        {
            "name": "SMS Campaign",
            "description": "SMS Campaign"
        },
        {
            "name": "SMS Campaign Insert Loop",
            "description": "SMS Campaign Insert Loop"
        },
        {
            "name": "SMS Credits",
            "description": "SMS Credits"
        },
        {
            "name": "SMS Credits Used",
            "description": "SMS Credits Used"
        },
        {
            "name": "SMS",
            "description": "SMS"
        },
        {
            "name": "Status",
            "description": "Status"
        },
        {
            "name": "Stripe",
            "description": "Stripe"
        },
        {
            "name": "Swagger",
            "description": "Swagger"
        },
        {
            "name": "Team",
            "description": "Team"
        },
        {
            "name": "Team Members",
            "description": "Team Members"
        },
        {
            "name": "TelsaLeads Webhook",
            "description": "TelsaLeads Webhook"
        },
        {
            "name": "Ticket Types",
            "description": "Ticket Types"
        },
        {
            "name": "Ticket Type",
            "description": "Ticket Type"
        },
        {
            "name": "Tiktok",
            "description": "Tiktok"
        },
        {
            "name": "Twitter",
            "description": "Twitter"
        },
        {
            "name": "User",
            "description": "User"
        },
        {
            "name": "User Feedback",
            "description": "User Feedback"
        },
        {
            "name": "WhatsApp Business",
            "description": "WhatsApp Business"
        },
        {
            "name": "User Media",
            "description": "User Media"
        },
        {
            "name": "User Notification Setting",
            "description": "User Notification Setting"
        },
        {
            "name": "Visitors",
            "description": "Visitors"
        },
        {
            "name": "Website Templates",
            "description": "Website Templates"
        },
        {
            "name": "Whatsapp Business",
            "description": "Whatsapp Business"
        },
        {
            "name": "Whatsapp Templates",
            "description": "Whatsapp Templates"
        },
        {
            "name": "Xero Dashboard",
            "description": "Xero Dashboard"
        },
        {
            "name": "Xero Reports",
            "description": "Xero Reports"
        },
        {
            "name": "Xero Integration",
            "description": "Xero Integration"
        },
        {
            "name": "Zapier Webhooks",
            "description": "Zapier Webhooks"
        },
        {
            "name": "Zapier",
            "description": "Zapier"
        },
        {
            "name": "Zapier Hooks",
            "description": "Zapier Hooks"
        }
    ]
}